projects
/
awesomized
/
libmemcached
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
|
github
raw
|
patch
| inline |
side by side
(parent:
f5ab8b6
)
Fix for prefix key checking in prefix
author
<brian@gir-3.local>
<>
Mon, 30 Jun 2008 18:17:09 +0000
(11:17 -0700)
committer
<brian@gir-3.local>
<>
Mon, 30 Jun 2008 18:17:09 +0000
(11:17 -0700)
libmemcached/memcached_callback.c
patch
|
blob
|
history
diff --git
a/libmemcached/memcached_callback.c
b/libmemcached/memcached_callback.c
index ad1ce2b1e65bb4d2bb81478201d1a76320c1231f..52afbb947117f37b55e0db5a427a832b6860fe60 100644
(file)
--- a/
libmemcached/memcached_callback.c
+++ b/
libmemcached/memcached_callback.c
@@
-19,7
+19,11
@@
memcached_return memcached_callback_set(memcached_st *ptr,
if (key)
{
- ptr->prefix_key_length= strlen(key);
+ size_t key_length= strlen(key);
+
+ if ((ptr->flags & MEM_VERIFY_KEY) && (memcachd_key_test((char **)&key, &key_length, 1) == MEMCACHED_BAD_KEY_PROVIDED))
+ return MEMCACHED_BAD_KEY_PROVIDED;
+
if ((ptr->prefix_key_length > MEMCACHED_PREFIX_KEY_MAX_SIZE -1)
|| (strcpy(ptr->prefix_key, key) == NULL))
{