From be17fb808a4d60f2a21017bd7bf1b0fef2d47cd1 Mon Sep 17 00:00:00 2001 From: ckolivas Date: Thu, 28 Jan 2016 15:46:36 +1100 Subject: [PATCH] Dont zero binary data eom --- src/ckpool.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/ckpool.c b/src/ckpool.c index 5e5d70d0..5427fd65 100644 --- a/src/ckpool.c +++ b/src/ckpool.c @@ -761,13 +761,13 @@ int read_socket_line(connsock_t *cs, float *timeout) if (unlikely(ret > 5) && (bkey = strstr(cs->buf + ret - 5, "bkey"))) { eom = bkey_eom(ckp, cs, bkey, timeout); ret = eom - cs->buf; - } + } else + *eom = '\0'; cs->buflen = cs->buf + cs->bufofs - eom - 1; if (cs->buflen) cs->bufofs = eom - cs->buf + 1; else cs->bufofs = 0; - *eom = '\0'; out: if (ret < 0) { empty_buffer(cs);