diff options
author | Denys Vlasenko | 2011-08-28 13:00:29 +0200 |
---|---|---|
committer | Denys Vlasenko | 2011-08-28 13:00:29 +0200 |
commit | cc272b06eefb87030bb85b686abdbc22b5ed1c34 (patch) | |
tree | 06024199184cfab43807a1fdcc2a240b9cf5ac99 /archival/libarchive/decompress_uncompress.c | |
parent | d84b175cb6948eb17f847313bf912174e2f934e1 (diff) | |
download | busybox-cc272b06eefb87030bb85b686abdbc22b5ed1c34.zip busybox-cc272b06eefb87030bb85b686abdbc22b5ed1c34.tar.gz |
Apply post-1.19.0 patches, bump version to 1.19.11_19_1
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'archival/libarchive/decompress_uncompress.c')
-rw-r--r-- | archival/libarchive/decompress_uncompress.c | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/archival/libarchive/decompress_uncompress.c b/archival/libarchive/decompress_uncompress.c index 44d8942..d1061a2 100644 --- a/archival/libarchive/decompress_uncompress.c +++ b/archival/libarchive/decompress_uncompress.c @@ -163,7 +163,8 @@ unpack_Z_stream(int fd_in, int fd_out) if (insize < (int) (IBUFSIZ + 64) - IBUFSIZ) { rsize = safe_read(fd_in, inbuf + insize, IBUFSIZ); -//error check?? + if (rsize < 0) + bb_error_msg_and_die(bb_msg_read_error); insize += rsize; } @@ -195,6 +196,8 @@ unpack_Z_stream(int fd_in, int fd_out) if (oldcode == -1) { + if (code >= 256) + bb_error_msg_and_die("corrupted data"); /* %ld", code); */ oldcode = code; finchar = (int) oldcode; outbuf[outpos++] = (unsigned char) finchar; @@ -239,6 +242,8 @@ unpack_Z_stream(int fd_in, int fd_out) /* Generate output characters in reverse order */ while ((long) code >= (long) 256) { + if (stackp <= &htabof(0)) + bb_error_msg_and_die("corrupted data"); *--stackp = tab_suffixof(code); code = tab_prefixof(code); } @@ -263,8 +268,7 @@ unpack_Z_stream(int fd_in, int fd_out) } if (outpos >= OBUFSIZ) { - full_write(fd_out, outbuf, outpos); -//error check?? + xwrite(fd_out, outbuf, outpos); IF_DESKTOP(total_written += outpos;) outpos = 0; } @@ -292,8 +296,7 @@ unpack_Z_stream(int fd_in, int fd_out) } while (rsize > 0); if (outpos > 0) { - full_write(fd_out, outbuf, outpos); -//error check?? + xwrite(fd_out, outbuf, outpos); IF_DESKTOP(total_written += outpos;) } |