mirror of
https://github.com/fluencelabs/redis
synced 2025-03-20 09:30:55 +00:00
fix crash in BITFIELD GET on non existing key or wrong type see #3259
this was a bug in the recent refactoring: bee963c4459223d874e3294a0d8638a588d33c8e
This commit is contained in:
parent
8c4f4d12d8
commit
c4433d2a6a
@ -1049,12 +1049,14 @@ void bitfieldCommand(client *c) {
|
||||
} else {
|
||||
/* GET */
|
||||
unsigned char buf[9];
|
||||
long strlen;
|
||||
long strlen = 0;
|
||||
unsigned char *src = NULL;
|
||||
char llbuf[LONG_STR_SIZE];
|
||||
|
||||
o = lookupKeyRead(c->db,c->argv[1]);
|
||||
src = getObjectReadOnlyString(o,&strlen,llbuf);
|
||||
if ((o = lookupKeyRead(c->db,c->argv[1])) != NULL) {
|
||||
if (checkType(c,o,OBJ_STRING)) continue;
|
||||
src = getObjectReadOnlyString(o,&strlen,llbuf);
|
||||
}
|
||||
|
||||
/* For GET we use a trick: before executing the operation
|
||||
* copy up to 9 bytes to a local buffer, so that we can easily
|
||||
|
Loading…
x
Reference in New Issue
Block a user