diff options
author | dormando <dormando@rydia.net> | 2020-11-12 16:35:13 -0800 |
---|---|---|
committer | dormando <dormando@rydia.net> | 2021-06-07 22:06:55 -0700 |
commit | d0b560d91a3bf7b7cda93759c48b5319e9743911 (patch) | |
tree | 97ba7fa11a1135ebd4303846532a66639a530057 /items.c | |
parent | f4aee656741421a41bc5e128f10e15be703c8927 (diff) | |
download | memcached-d0b560d91a3bf7b7cda93759c48b5319e9743911.tar.gz |
meta: protect cachedump from bin keys and add docs
cachedump was the only place in the codebase I can find which copied
the key verbatim. wonder when I can finally remove the command :)
Diffstat (limited to 'items.c')
-rw-r--r-- | items.c | 3 |
1 files changed, 2 insertions, 1 deletions
@@ -614,7 +614,8 @@ char *item_cachedump(const unsigned int slabs_clsid, const unsigned int limit, u while (it != NULL && (limit == 0 || shown < limit)) { assert(it->nkey <= KEY_MAX_LENGTH); - if (it->nbytes == 0 && it->nkey == 0) { + // protect from printing binary keys. + if ((it->nbytes == 0 && it->nkey == 0) || (it->it_flags & ITEM_KEY_BINARY)) { it = it->next; continue; } |