X-Git-Url: https://git.m6w6.name/?a=blobdiff_plain;f=libmemcached%2Fmemcached_callback.c;h=5e36ddf6cfc04d57dbfd248535758a54e0718ab1;hb=88d4a911457b86d76908dd8ee25cc47ef2fe6aa9;hp=52afbb947117f37b55e0db5a427a832b6860fe60;hpb=528741ce60dfd864facfb338ef4de7c3cbcd00c5;p=awesomized%2Flibmemcached diff --git a/libmemcached/memcached_callback.c b/libmemcached/memcached_callback.c index 52afbb94..5e36ddf6 100644 --- a/libmemcached/memcached_callback.c +++ b/libmemcached/memcached_callback.c @@ -22,14 +22,20 @@ memcached_return memcached_callback_set(memcached_st *ptr, 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) + if ((key_length > MEMCACHED_PREFIX_KEY_MAX_SIZE -1) || (strcpy(ptr->prefix_key, key) == NULL)) { ptr->prefix_key_length= 0; return MEMCACHED_BAD_KEY_PROVIDED; } + else + { + ptr->prefix_key_length= key_length; + } } else {