From a3e9344103525dbbb7dc8cd70a4b8c1df134685d Mon Sep 17 00:00:00 2001 From: Sage Weil Date: Fri, 27 Sep 2013 15:29:18 -0700 Subject: [PATCH] common/buffer: explicitly init zbuf to zeros This might not be necessary? Signed-off-by: Sage Weil --- src/common/buffer.cc | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/src/common/buffer.cc b/src/common/buffer.cc index 3a8190f0280be..064775d299312 100644 --- a/src/common/buffer.cc +++ b/src/common/buffer.cc @@ -31,8 +31,17 @@ namespace ceph { - -static unsigned char zbuf[128]; + // some zeros; used when concatenating buffers with cached crc + static unsigned char zbuf[128] = { + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 + }; #ifdef BUFFER_DEBUG static uint32_t simple_spinlock_t buffer_debug_lock = SIMPLE_SPINLOCK_INITIALIZER; -- 2.39.5