From ef311edff106c37bf5e62e3660b803dd09c04e32 Mon Sep 17 00:00:00 2001 From: Francesc Alted Date: Thu, 20 Mar 2014 11:17:18 +0100 Subject: [PATCH] Fixed a false buffer overrun condition. --- blosc/blosc.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/blosc/blosc.c b/blosc/blosc.c index 53d26130..29830a34 100644 --- a/blosc/blosc.c +++ b/blosc/blosc.c @@ -527,7 +527,7 @@ static int blosc_c(int32_t blocksize, int32_t leftoverblock, return -5; /* signals no compression support */ } - if (cbytes >= maxout) { + if (cbytes > maxout) { /* Buffer overrun caused by compression (should never happen) */ return -1; } @@ -536,7 +536,7 @@ static int blosc_c(int32_t blocksize, int32_t leftoverblock, return -2; } else if (cbytes == 0) { - /* The compressor has been unable to compress data significantly. */ + /* The compressor has been unable to compress data at all. */ /* Before doing the copy, check that we are not running into a buffer overflow. */ if ((ntbytes+neblock) > maxbytes) {