projects
/
zchunk.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
ef3b1ab
)
Fix length calculation in compint
author
Jonathan Dieter
<jdieter@gmail.com>
Wed, 11 Jul 2018 12:11:55 +0000
(13:11 +0100)
committer
Jonathan Dieter
<jdieter@gmail.com>
Wed, 11 Jul 2018 12:11:55 +0000
(13:11 +0100)
Signed-off-by: Jonathan Dieter <jdieter@gmail.com>
src/lib/compint.c
patch
|
blob
|
history
diff --git
a/src/lib/compint.c
b/src/lib/compint.c
index 89b9c7a35b4fbeb2a2a89d5d2dfb90be4f711b26..8053509558eab0e462074847b0d17fb3d8083b70 100644
(file)
--- 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