Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
ruanhaishen
redis
Commits
c4433d2a
Commit
c4433d2a
authored
May 24, 2016
by
oranagra
Browse files
fix crash in BITFIELD GET on non existing key or wrong type see #3259
this was a bug in the recent refactoring:
bee963c4
parent
8c4f4d12
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/bitops.c
View file @
c4433d2a
...
@@ -1049,12 +1049,14 @@ void bitfieldCommand(client *c) {
...
@@ -1049,12 +1049,14 @@ void bitfieldCommand(client *c) {
}
else
{
}
else
{
/* GET */
/* GET */
unsigned
char
buf
[
9
];
unsigned
char
buf
[
9
];
long
strlen
;
long
strlen
=
0
;
unsigned
char
*
src
=
NULL
;
unsigned
char
*
src
=
NULL
;
char
llbuf
[
LONG_STR_SIZE
];
char
llbuf
[
LONG_STR_SIZE
];
o
=
lookupKeyRead
(
c
->
db
,
c
->
argv
[
1
]);
if
((
o
=
lookupKeyRead
(
c
->
db
,
c
->
argv
[
1
]))
!=
NULL
)
{
src
=
getObjectReadOnlyString
(
o
,
&
strlen
,
llbuf
);
if
(
checkType
(
c
,
o
,
OBJ_STRING
))
continue
;
src
=
getObjectReadOnlyString
(
o
,
&
strlen
,
llbuf
);
}
/* For GET we use a trick: before executing the operation
/* For GET we use a trick: before executing the operation
* copy up to 9 bytes to a local buffer, so that we can easily
* copy up to 9 bytes to a local buffer, so that we can easily
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment