From: Jonathan Dieter Date: Wed, 11 Jul 2018 12:11:55 +0000 (+0100) Subject: Fix length calculation in compint X-Git-Tag: archive/raspbian/1.1.9+ds1-1+rpi1~1^2~202 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=990b758bbe8b1808350d90f3bbce510eb2cb2550;p=zchunk.git Fix length calculation in compint Signed-off-by: Jonathan Dieter --- diff --git a/src/lib/compint.c b/src/lib/compint.c index 89b9c7a..8053509 100644 --- a/src/lib/compint.c +++ b/src/lib/compint.c @@ -65,8 +65,7 @@ int compint_to_size(size_t *val, const char *compint, size_t *length, break; i++; /* Make sure we're not overflowing and fail if we do */ - if(count > MAX_COMP_SIZE || count+*length > max_length || - *val < old_val) { + if(count > MAX_COMP_SIZE || count > max_length || *val < old_val) { if(count > max_length) zck_log(ZCK_LOG_ERROR, "Read past end of header\n"); else