Permalink
Browse files

Use strncmp when checking for large ascii multigets.

  • Loading branch information...
1 parent ea0fec7 commit d9cd01ede97f4145af9781d448c62a3318952719 @kroki kroki committed with dustin Nov 2, 2009
Showing with 3 additions and 1 deletion.
  1. +3 −1 memcached.c
View
@@ -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;
}

0 comments on commit d9cd01e

Please sign in to comment.