Skip to content

Commit

Permalink
Use strncmp when checking for large ascii multigets.
Browse files Browse the repository at this point in the history
  • Loading branch information
kroki authored and dustin committed Nov 2, 2009
1 parent ea0fec7 commit d9cd01e
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion memcached.c
Expand Up @@ -3148,7 +3148,9 @@ static int try_read_command(conn *c) {
++ptr;
}

if (strcmp(ptr, "get ") && strcmp(ptr, "gets ")) {
if (ptr - c->rcurr > 100 ||
(strncmp(ptr, "get ", 4) && strncmp(ptr, "gets ", 5))) {

conn_set_state(c, conn_closing);
return 1;
}
Expand Down

0 comments on commit d9cd01e

Please sign in to comment.