projects
/
m6w6
/
libmemcached
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
|
github
raw
|
inline
| side by side
fix bug, trying to walk off the end of the argv array
[m6w6/libmemcached]
/
lib
/
memcached_response.c
diff --git
a/lib/memcached_response.c
b/lib/memcached_response.c
index ec29f0aa230292d455528d24e61b99e9361dc560..693f9b30520a71c0f21f875ffc095090b25e8c6f 100644
(file)
--- a/
lib/memcached_response.c
+++ b/
lib/memcached_response.c
@@
-43,8
+43,15
@@
memcached_return memcached_response(memcached_st *ptr,
else
return MEMCACHED_UNKNOWN_READ_FAILURE;
}
else
return MEMCACHED_UNKNOWN_READ_FAILURE;
}
- case 'E': /* PROTOCOL ERROR */
- return MEMCACHED_PROTOCOL_ERROR;
+ case 'E': /* PROTOCOL ERROR or END */
+ {
+ if (buffer[1] == 'N')
+ return MEMCACHED_NOTFOUND;
+ else if (buffer[1] == 'R')
+ return MEMCACHED_PROTOCOL_ERROR;
+ else
+ return MEMCACHED_UNKNOWN_READ_FAILURE;
+ }
case 'C': /* CLIENT ERROR */
return MEMCACHED_CLIENT_ERROR;
default:
case 'C': /* CLIENT ERROR */
return MEMCACHED_CLIENT_ERROR;
default: