Merge pull request #170 from nmoinvaz/fixes/msan-error-dist

Fixed use-of-uninitialized value msan error when copying dist bytes
This commit is contained in:
Martin Raiber
2020-11-08 23:23:59 +01:00
committed by GitHub

View File

@@ -498,7 +498,7 @@ tinfl_status tinfl_decompress(tinfl_decompressor *r, const mz_uint8 *pIn_buf_nex
} }
dist_from_out_buf_start = pOut_buf_cur - pOut_buf_start; dist_from_out_buf_start = pOut_buf_cur - pOut_buf_start;
if ((dist > dist_from_out_buf_start) && (decomp_flags & TINFL_FLAG_USING_NON_WRAPPING_OUTPUT_BUF)) if ((dist > dist_from_out_buf_start || dist_from_out_buf_start == 0) && (decomp_flags & TINFL_FLAG_USING_NON_WRAPPING_OUTPUT_BUF))
{ {
TINFL_CR_RETURN_FOREVER(37, TINFL_STATUS_FAILED); TINFL_CR_RETURN_FOREVER(37, TINFL_STATUS_FAILED);
} }