diff options
-rw-r--r-- | archival/libarchive/decompress_unlzma.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/archival/libarchive/decompress_unlzma.c b/archival/libarchive/decompress_unlzma.c index a9040877e..be4342414 100644 --- a/archival/libarchive/decompress_unlzma.c +++ b/archival/libarchive/decompress_unlzma.c | |||
@@ -450,8 +450,12 @@ unpack_lzma_stream(transformer_state_t *xstate) | |||
450 | IF_NOT_FEATURE_LZMA_FAST(string:) | 450 | IF_NOT_FEATURE_LZMA_FAST(string:) |
451 | do { | 451 | do { |
452 | uint32_t pos = buffer_pos - rep0; | 452 | uint32_t pos = buffer_pos - rep0; |
453 | if ((int32_t)pos < 0) | 453 | if ((int32_t)pos < 0) { |
454 | pos += header.dict_size; | 454 | pos += header.dict_size; |
455 | /* bug 10436 has an example file where this triggers: */ | ||
456 | if ((int32_t)pos < 0) | ||
457 | goto bad; | ||
458 | } | ||
455 | previous_byte = buffer[pos]; | 459 | previous_byte = buffer[pos]; |
456 | IF_NOT_FEATURE_LZMA_FAST(one_byte2:) | 460 | IF_NOT_FEATURE_LZMA_FAST(one_byte2:) |
457 | buffer[buffer_pos++] = previous_byte; | 461 | buffer[buffer_pos++] = previous_byte; |