summaryrefslogtreecommitdiff
path: root/items.c
diff options
context:
space:
mode:
authorMatthew Shafer <matthewshafer@mac.com>2019-05-24 21:01:56 -0700
committerdormando <dormando@rydia.net>2019-05-24 22:01:56 -0700
commit78eb7701e0823643d693c1a7a6fd8a0c75db74d8 (patch)
tree0b284333fcf418ff8fdf29bad82c1260b7a61301 /items.c
parent79f90d1ebfa61786ad7a821e4aa42da589c77ba5 (diff)
downloadmemcached-78eb7701e0823643d693c1a7a6fd8a0c75db74d8.tar.gz
When nsuffix is 0 space for flags hasn't been allocated so don't memcpy them.1.5.16
Diffstat (limited to 'items.c')
-rw-r--r--items.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/items.c b/items.c
index 8500f75..77b8296 100644
--- a/items.c
+++ b/items.c
@@ -330,7 +330,9 @@ item *do_item_alloc(char *key, const size_t nkey, const unsigned int flags,
it->nbytes = nbytes;
memcpy(ITEM_key(it), key, nkey);
it->exptime = exptime;
- memcpy(ITEM_suffix(it), &flags, sizeof(flags));
+ if (nsuffix > 0) {
+ memcpy(ITEM_suffix(it), &flags, sizeof(flags));
+ }
/* Initialize internal chunk. */
if (it->it_flags & ITEM_CHUNKED) {