fix server crash in STRALGO command

(cherry picked from commit 2a05fa0d481d12d3747465c4f14470bdca100c5d)
This commit is contained in:
hwware 2020-06-08 23:36:01 -04:00 committed by Oran Agra
parent 845fb2d1c1
commit c1326d7b10

View File

@ -534,6 +534,13 @@ void stralgoLCS(client *c) {
} }
obja = lookupKeyRead(c->db,c->argv[j+1]); obja = lookupKeyRead(c->db,c->argv[j+1]);
objb = lookupKeyRead(c->db,c->argv[j+2]); objb = lookupKeyRead(c->db,c->argv[j+2]);
if ( !(obja->type == OBJ_STRING) || !(objb->type == OBJ_STRING) ) {
addReplyError(c,"Object associate with KEYS option should only be string type");
return;
}
obja = obja ? getDecodedObject(obja) : createStringObject("",0); obja = obja ? getDecodedObject(obja) : createStringObject("",0);
objb = objb ? getDecodedObject(objb) : createStringObject("",0); objb = objb ? getDecodedObject(objb) : createStringObject("",0);
a = obja->ptr; a = obja->ptr;