Skip to content
Commit 4668feaa authored by Hans Wennborg's avatar Hans Wennborg Committed by Copybara-Service
Browse files

[zlib] Avoid crashing in check_match when prev_match == -1

prev_match can be set to -1 after sliding the window. In that case, the
window has slid past the first byte of the last match, which means it
cannot be compared in check_match.

This would cause zlib to crash on some inputs to deflate when built
with ZLIB_DEBUG enabled.

Check for this situation and avoid crashing by not trying to compare
the first byte.

Bug: 1113142
Change-Id: I26f006d81b91591e07fb02207e64b8440f7a5c50
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2426443


Commit-Queue: Hans Wennborg <hans@chromium.org>
Reviewed-by: default avatarAdenilson Cavalcanti <cavalcantii@chromium.org>
Cr-Commit-Position: refs/heads/master@{#810195}
GitOrigin-RevId: c1560c99950947946ff9b5d5978f70bc975ab3af
parent f8517bd6
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment