diff options
author | Tharanga Gamaethige <tgamaethige@netflix.com> | 2019-05-17 18:13:30 -0700 |
---|---|---|
committer | dormando <dormando@rydia.net> | 2019-05-20 13:24:20 -0700 |
commit | 43c0c37ba66ba10b6d58788d2d86cc7481cb3c6f (patch) | |
tree | a67edeec48d30012a93512e647a21d82b7ff1b03 /crawler.c | |
parent | b1425dcb62f98ee20f5be68d0d95e78dfd9c993f (diff) | |
download | memcached-43c0c37ba66ba10b6d58788d2d86cc7481cb3c6f.tar.gz |
Use correct buffer size for internal URI encoding.
Modified Logger and Crawler to use the correct buffer length when
they are printing URI encoded keys. Fixes #471
Diffstat (limited to 'crawler.c')
-rw-r--r-- | crawler.c | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -238,7 +238,7 @@ static void crawler_expired_eval(crawler_module_t *cm, item *search, uint32_t hv static void crawler_metadump_eval(crawler_module_t *cm, item *it, uint32_t hv, int i) { //int slab_id = CLEAR_LRU(i); - char keybuf[KEY_MAX_LENGTH * 3 + 1]; + char keybuf[KEY_MAX_URI_ENCODED_LENGTH]; int is_flushed = item_is_flushed(it); /* Ignore expired content. */ if ((it->exptime != 0 && it->exptime < current_time) @@ -247,7 +247,7 @@ static void crawler_metadump_eval(crawler_module_t *cm, item *it, uint32_t hv, i return; } // TODO: uriencode directly into the buffer. - uriencode(ITEM_key(it), keybuf, it->nkey, KEY_MAX_LENGTH * 3 + 1); + uriencode(ITEM_key(it), keybuf, it->nkey, KEY_MAX_URI_ENCODED_LENGTH); int total = snprintf(cm->c.cbuf, 4096, "key=%s exp=%ld la=%llu cas=%llu fetch=%s cls=%u size=%lu\n", keybuf, |