Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Use strncmp when checking for large ascii multigets.

  • Loading branch information...
commit d9cd01ede97f4145af9781d448c62a3318952719 1 parent ea0fec7
Tomash Brechko authored November 02, 2009 dustin committed November 02, 2009

Showing 1 changed file with 3 additions and 1 deletion. Show diff stats Hide diff stats

  1. 4  memcached.c
4  memcached.c
@@ -3148,7 +3148,9 @@ static int try_read_command(conn *c) {
3148 3148
                     ++ptr;
3149 3149
                 }
3150 3150
 
3151  
-                if (strcmp(ptr, "get ") && strcmp(ptr, "gets ")) {
  3151
+                if (ptr - c->rcurr > 100 ||
  3152
+                    (strncmp(ptr, "get ", 4) && strncmp(ptr, "gets ", 5))) {
  3153
+
3152 3154
                     conn_set_state(c, conn_closing);
3153 3155
                     return 1;
3154 3156
                 }

0 notes on commit d9cd01e

Please sign in to comment.
Something went wrong with that request. Please try again.