projects
/
m6w6
/
libmemcached
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
|
github
raw
|
inline
| side by side
We now check return key size for memcached_fetch() to make sure it is not
[m6w6/libmemcached]
/
libmemcached
/
response.c
diff --git
a/libmemcached/response.c
b/libmemcached/response.c
index afaed844c66b1d6e81116e4cf0855b2d5f36deae..cbb49784b18d1cb270e519f6db56ddc5a8255ba7 100644
(file)
--- a/
libmemcached/response.c
+++ b/
libmemcached/response.c
@@
-110,7
+110,7
@@
static memcached_return_t textual_value_fetch(memcached_server_instance_st *ptr,
char *key;
size_t prefix_length;
char *key;
size_t prefix_length;
- key= result->key;
+ key= result->
item_
key;
result->key_length= 0;
for (prefix_length= ptr->root->prefix_key_length; !(iscntrl(*string_ptr) || isspace(*string_ptr)) ; string_ptr++)
result->key_length= 0;
for (prefix_length= ptr->root->prefix_key_length; !(iscntrl(*string_ptr) || isspace(*string_ptr)) ; string_ptr++)
@@
-124,7
+124,7
@@
static memcached_return_t textual_value_fetch(memcached_server_instance_st *ptr,
else
prefix_length--;
}
else
prefix_length--;
}
- result->key[result->key_length]= 0;
+ result->
item_
key[result->key_length]= 0;
}
if (end_ptr == string_ptr)
}
if (end_ptr == string_ptr)
@@
-135,7
+135,7
@@
static memcached_return_t textual_value_fetch(memcached_server_instance_st *ptr,
if (end_ptr == string_ptr)
goto read_error;
for (next_ptr= string_ptr; isdigit(*string_ptr); string_ptr++);
if (end_ptr == string_ptr)
goto read_error;
for (next_ptr= string_ptr; isdigit(*string_ptr); string_ptr++);
- result->flags= (uint32_t) strtoul(next_ptr, &string_ptr, 10);
+ result->
item_
flags= (uint32_t) strtoul(next_ptr, &string_ptr, 10);
if (end_ptr == string_ptr)
goto read_error;
if (end_ptr == string_ptr)
goto read_error;
@@
-161,7
+161,7
@@
static memcached_return_t textual_value_fetch(memcached_server_instance_st *ptr,
{
string_ptr++;
for (next_ptr= string_ptr; isdigit(*string_ptr); string_ptr++);
{
string_ptr++;
for (next_ptr= string_ptr; isdigit(*string_ptr); string_ptr++);
- result->cas= strtoull(next_ptr, &string_ptr, 10);
+ result->
item_
cas= strtoull(next_ptr, &string_ptr, 10);
}
if (end_ptr < string_ptr)
}
if (end_ptr < string_ptr)
@@
-364,17
+364,17
@@
static memcached_return_t binary_read_one_response(memcached_server_instance_st
{
uint16_t keylen= header.response.keylen;
memcached_result_reset(result);
{
uint16_t keylen= header.response.keylen;
memcached_result_reset(result);
- result->cas= header.response.cas;
+ result->
item_
cas= header.response.cas;
- if (memcached_safe_read(ptr, &result->flags,
- sizeof (result->flags)) != MEMCACHED_SUCCESS)
+ if (memcached_safe_read(ptr, &result->
item_
flags,
+ sizeof (result->
item_
flags)) != MEMCACHED_SUCCESS)
return MEMCACHED_UNKNOWN_READ_FAILURE;
return MEMCACHED_UNKNOWN_READ_FAILURE;
- result->
flags= ntohl(result->
flags);
+ result->
item_flags= ntohl(result->item_
flags);
bodylen -= header.response.extlen;
result->key_length= keylen;
bodylen -= header.response.extlen;
result->key_length= keylen;
- if (memcached_safe_read(ptr, result->key, keylen) != MEMCACHED_SUCCESS)
+ if (memcached_safe_read(ptr, result->
item_
key, keylen) != MEMCACHED_SUCCESS)
return MEMCACHED_UNKNOWN_READ_FAILURE;
bodylen -= keylen;
return MEMCACHED_UNKNOWN_READ_FAILURE;
bodylen -= keylen;