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
8d673855
Commit
8d673855
authored
May 21, 2020
by
hwware
Committed by
antirez
May 22, 2020
Browse files
fix server crash for STRALGO command
parent
7a35eec5
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/t_string.c
View file @
8d673855
...
@@ -519,7 +519,7 @@ void stralgoLCS(client *c) {
...
@@ -519,7 +519,7 @@ void stralgoLCS(client *c) {
!=
C_OK
)
return
;
!=
C_OK
)
return
;
if
(
minmatchlen
<
0
)
minmatchlen
=
0
;
if
(
minmatchlen
<
0
)
minmatchlen
=
0
;
j
++
;
j
++
;
}
else
if
(
!
strcasecmp
(
opt
,
"STRINGS"
))
{
}
else
if
(
!
strcasecmp
(
opt
,
"STRINGS"
)
&&
(
c
->
argc
-
j
)
>
2
)
{
if
(
a
!=
NULL
)
{
if
(
a
!=
NULL
)
{
addReplyError
(
c
,
"Either use STRINGS or KEYS"
);
addReplyError
(
c
,
"Either use STRINGS or KEYS"
);
return
;
return
;
...
@@ -527,7 +527,7 @@ void stralgoLCS(client *c) {
...
@@ -527,7 +527,7 @@ void stralgoLCS(client *c) {
a
=
c
->
argv
[
j
+
1
]
->
ptr
;
a
=
c
->
argv
[
j
+
1
]
->
ptr
;
b
=
c
->
argv
[
j
+
2
]
->
ptr
;
b
=
c
->
argv
[
j
+
2
]
->
ptr
;
j
+=
2
;
j
+=
2
;
}
else
if
(
!
strcasecmp
(
opt
,
"KEYS"
))
{
}
else
if
(
!
strcasecmp
(
opt
,
"KEYS"
)
&&
(
c
->
argc
-
j
)
>
2
)
{
if
(
a
!=
NULL
)
{
if
(
a
!=
NULL
)
{
addReplyError
(
c
,
"Either use STRINGS or KEYS"
);
addReplyError
(
c
,
"Either use STRINGS or KEYS"
);
return
;
return
;
...
...
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