Skip to content

Commit d9cd01e

Browse files
krokidustin
authored andcommitted
Use strncmp when checking for large ascii multigets.
1 parent ea0fec7 commit d9cd01e

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

Diff for: memcached.c

+3-1
Original file line numberDiff line numberDiff line change
@@ -3148,7 +3148,9 @@ static int try_read_command(conn *c) {
31483148
++ptr;
31493149
}
31503150

3151-
if (strcmp(ptr, "get ") && strcmp(ptr, "gets ")) {
3151+
if (ptr - c->rcurr > 100 ||
3152+
(strncmp(ptr, "get ", 4) && strncmp(ptr, "gets ", 5))) {
3153+
31523154
conn_set_state(c, conn_closing);
31533155
return 1;
31543156
}

0 commit comments

Comments
 (0)