diff options
author | Matthew Shafer <matthewshafer@mac.com> | 2019-05-24 21:01:56 -0700 |
---|---|---|
committer | dormando <dormando@rydia.net> | 2019-05-24 22:01:56 -0700 |
commit | 78eb7701e0823643d693c1a7a6fd8a0c75db74d8 (patch) | |
tree | 0b284333fcf418ff8fdf29bad82c1260b7a61301 /items.c | |
parent | 79f90d1ebfa61786ad7a821e4aa42da589c77ba5 (diff) | |
download | memcached-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.c | 4 |
1 files changed, 3 insertions, 1 deletions
@@ -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) { |