X-Git-Url: https://git.m6w6.name/?a=blobdiff_plain;f=libmemcached%2Fmemcached_key.c;h=c992c338c7248a688197691db0024895b9d708d7;hb=c3dd2b1a405b440095f45b6f5ad8b4d4fd0d83a2;hp=b8291ed77b31b1f77c3b38e420093cbdde1243bd;hpb=2b312deb8b7b3f662b492f94a13e673723387724;p=m6w6%2Flibmemcached diff --git a/libmemcached/memcached_key.c b/libmemcached/memcached_key.c index b8291ed7..c992c338 100644 --- a/libmemcached/memcached_key.c +++ b/libmemcached/memcached_key.c @@ -1,16 +1,20 @@ #include "common.h" -memcached_return memcachd_key_test(char **keys, size_t *key_length, - unsigned int number_of_keys) +memcached_return memcached_key_test(const char **keys, size_t *key_length, + unsigned int number_of_keys) { uint32_t x; + memcached_return rc; for (x= 0; x < number_of_keys; x++) { size_t y; - if (*(key_length + x) == 0) - return MEMCACHED_BAD_KEY_PROVIDED; + rc= memcached_validate_key_length(*(key_length + x), false); + if (rc != MEMCACHED_SUCCESS) + return rc; + + for (y= 0; y < *(key_length + x); y++) {