libmemcache block caused by inproper read() calls (patch supplied)

John McCaskey johnm at klir.com
Mon May 16 21:51:21 PDT 2005


Skipped content of type multipart/alternative-------------- next part --------------
--- memcache.c.1	2005-03-22 04:56:02.000000000 +0000
+++ memcache.c	2005-05-17 04:42:26.269605576 +0000
@@ -995,7 +995,7 @@ next_value:
   if (len == 0) {
     /* We haven't yet read a "header" line VALUE ... .. ..\r\n This
      * should be one. Try to match it. */
-    end = memchr(ms->start, (int)'\n', ms->size - (size_t)(ms->read_cur - ms->buf));
+	end = memchr(ms->start, (int)'\n', (size_t)(ms->read_cur-ms->start));
     if(end == NULL) {
       /* No \n yet... keep reading... */
       goto read_more;


More information about the memcached mailing list