From f7b5dc65ad09236147cd10027921c7a652d6ccbe Mon Sep 17 00:00:00 2001 From: Fabian Keil Date: Thu, 23 Jun 2011 13:57:47 +0000 Subject: [PATCH] In decompress_iob() change a buffer limit check from '==' to the '>=' one would expect at first glance. At the same time explain why we don't really have to. --- parsers.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/parsers.c b/parsers.c index e7a22e24..11845600 100644 --- a/parsers.c +++ b/parsers.c @@ -1,4 +1,4 @@ -const char parsers_rcs[] = "$Id: parsers.c,v 1.221 2011/03/27 14:01:46 fabiankeil Exp $"; +const char parsers_rcs[] = "$Id: parsers.c,v 1.222 2011/04/19 13:00:47 fabiankeil Exp $"; /********************************************************************* * * File : $Source: /cvsroot/ijbswa/current/parsers.c,v $ @@ -619,10 +619,12 @@ jb_err decompress_iob(struct client_state *csp) } /* - * If we tried the limit and still didn't have enough - * memory, just give up. + * If we reached the buffer limit and still didn't have enough + * memory, just give up. Due to the ceiling enforced by the next + * if block we could actually check for equality here, but as it + * can be easily mistaken for a bug we don't. */ - if (bufsize == csp->config->buffer_limit) + if (bufsize >= csp->config->buffer_limit) { log_error(LOG_LEVEL_ERROR, "Buffer limit reached while decompressing iob"); return JB_ERR_MEMORY; -- 2.39.2