summaryrefslogtreecommitdiff
path: root/util.c
diff options
context:
space:
mode:
authorTharanga Gamaethige <tgamaethige@netflix.com>2019-05-17 18:13:30 -0700
committerdormando <dormando@rydia.net>2019-05-20 13:24:20 -0700
commit43c0c37ba66ba10b6d58788d2d86cc7481cb3c6f (patch)
treea67edeec48d30012a93512e647a21d82b7ff1b03 /util.c
parentb1425dcb62f98ee20f5be68d0d95e78dfd9c993f (diff)
downloadmemcached-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 'util.c')
-rw-r--r--util.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/util.c b/util.c
index 0ccbe4d..13e86ac 100644
--- a/util.c
+++ b/util.c
@@ -29,7 +29,7 @@ bool uriencode(const char *src, char *dst, const size_t srclen, const size_t dst
int x;
size_t d = 0;
for (x = 0; x < srclen; x++) {
- if (d + 4 >= dstlen)
+ if (d + 4 > dstlen)
return false;
if (uriencode_map[(unsigned char) src[x]] != NULL) {
memcpy(&dst[d], uriencode_map[(unsigned char) src[x]], 3);