This includes work for partitioning by key. Dormando wished for these methods.
[m6w6/libmemcached] / lib / memcached_response.c
index 78b314f42dc47864c15cc622ceea7b2a9f25cdba..076b0a6fc2bd67a49c3d5d22e50f9405102c0553 100644 (file)
@@ -43,6 +43,9 @@ memcached_return memcached_response(memcached_st *ptr,
 
       total_length++;
       WATCHPOINT_ASSERT(total_length < buffer_length);
+
+      if (total_length >= buffer_length)
+        return MEMCACHED_PROTOCOL_ERROR;
     }
     buffer_ptr++;
     *buffer_ptr= 0;