From 58de9c88544f94ad0835b8f95f65f1bf6857c5b0 Mon Sep 17 00:00:00 2001 From: Packit Service Date: Dec 09 2020 21:55:38 +0000 Subject: Apply patch memcached-restart-corrupted.patch patch_name: memcached-restart-corrupted.patch present_in_specfile: true location_in_specfile: 2 --- diff --git a/slabs.c b/slabs.c index 89a51ed..c49afa8 100644 --- a/slabs.c +++ b/slabs.c @@ -299,6 +299,10 @@ void slabs_prefill_global(void) { while (mem_malloced < mem_limit && (ptr = memory_allocate(len)) != NULL) { grow_slab_list(0); + // Ensure the front header is zero'd to avoid confusing restart code. + // It's probably good enough to cast it and just zero slabs_clsid, but + // this is extra paranoid. + memset(ptr, 0, sizeof(item)); p->slab_list[p->slabs++] = ptr; } mem_limit_reached = true;