[git commit] unlzma: do emit the error message on bad input, when we exit with 1
Denys Vlasenko
vda.linux at googlemail.com
Tue Apr 24 11:49:12 UTC 2018
commit: https://git.busybox.net/busybox/commit/?id=77bf05dfe39c507eafc6421ac66b4613aab5509f
branch: https://git.busybox.net/busybox/commit/?id=refs/heads/master
Signed-off-by: Denys Vlasenko <vda.linux at googlemail.com>
---
archival/libarchive/decompress_unlzma.c | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/archival/libarchive/decompress_unlzma.c b/archival/libarchive/decompress_unlzma.c
index 42efd5aa7..446319e7b 100644
--- a/archival/libarchive/decompress_unlzma.c
+++ b/archival/libarchive/decompress_unlzma.c
@@ -498,6 +498,12 @@ unpack_lzma_stream(transformer_state_t *xstate)
IF_DESKTOP(total_written += buffer_pos;)
if (transformer_write(xstate, buffer, buffer_pos) != (ssize_t)buffer_pos) {
bad:
+ /* One of our users, bbunpack(), expects _us_ to emit
+ * the error message (since it's the best place to give
+ * potentially more detailed information).
+ * Do not fail silently.
+ */
+ bb_error_msg("corrupted data");
total_written = -1; /* failure */
}
rc_free(rc);
More information about the busybox-cvs
mailing list