Skip to content

Commit 8f2dbc3

Browse files
committed
Fix crash
1 parent e7ab275 commit 8f2dbc3

2 files changed

Lines changed: 4 additions & 2 deletions

File tree

src/db.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3325,7 +3325,7 @@ void redisDbPersistentData::prefetchKeysAsync(client *c, parsed_command &command
33253325
}
33263326
}
33273327

3328-
void redisDbPersistentData::prefetchKeysFlash(std::unordered_set<client*> &setc)
3328+
void redisDbPersistentData::prefetchKeysFlash(const std::unordered_set<client*> &setc)
33293329
{
33303330
serverAssert(GlobalLocksAcquired());
33313331
std::vector<sds> veckeys;
@@ -3334,6 +3334,8 @@ void redisDbPersistentData::prefetchKeysFlash(std::unordered_set<client*> &setc)
33343334
for (client *c : setc) {
33353335
for (auto &command : c->vecqueuedcmd) {
33363336
getKeysResult result = GETKEYS_RESULT_INIT;
3337+
if (command.argc == 0) // parse can do this it will be handled by processClient
3338+
break;
33373339
auto cmd = lookupCommand(szFromObj(command.argv[0]));
33383340
if (cmd == nullptr)
33393341
break; // Bad command? It's not for us to judge, just bail

src/server.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1230,7 +1230,7 @@ class redisDbPersistentData
12301230
bool keycacheIsEnabled();
12311231

12321232
void prefetchKeysAsync(client *c, struct parsed_command &command);
1233-
void prefetchKeysFlash(std::unordered_set<client*> &setc);
1233+
void prefetchKeysFlash(const std::unordered_set<client*> &setc);
12341234
void processStorageToken(StorageToken *tok);
12351235

12361236
bool FSnapshot() const { return m_spdbSnapshotHOLDER != nullptr; }

0 commit comments

Comments
 (0)