unlzma: do emit the error message on bad input, when we exit with 1
authorDenys Vlasenko <vda.linux@googlemail.com>
Tue, 24 Apr 2018 11:49:12 +0000 (13:49 +0200)
committerDenys Vlasenko <vda.linux@googlemail.com>
Tue, 24 Apr 2018 11:49:12 +0000 (13:49 +0200)
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
archival/libarchive/decompress_unlzma.c

index 42efd5aa7f0a20108af183012954a6e03df9f3ca..446319e7ba8ac2ec1bbeaba51ff8821342be98e4 100644 (file)
@@ -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);