Avoid IndexOutOfRangeException in ZipArchive - #109168
Conversation
|
Hello, @ericstj , @dotnet/area-system-io-compression ! |
An IndexOutOfRangeException exception is thrown when this invalid zip file is opened with ZipArchive. This file is generated while fuzzing ZipArchive with AFL++. More details in issue and pull request: dotnet/runtime#109167 dotnet/runtime#109168
An IndexOutOfRangeException exception is thrown when this invalid zip file is opened with ZipArchive. This file is generated while fuzzing ZipArchive with AFL++. More details in issue and pull request: dotnet/runtime#109167 dotnet/runtime#109168
|
@peter15914 FYI you'll need to wait until #109477 is merged to be able to consume the runtime-assets changes. Once that PR is in you can merge main into your branch and you should be able to access the new file. |
Add test to cover problem with invalid zip file. Currently an IndexOutOfRangeException is thrown when invalid zip file is opened with ZipArchive.
|
@dotnet-policy-service agree |
|
Hello @stephentoub ! |
Thanks! |
ericstj
left a comment
There was a problem hiding this comment.
Left a small suggestion, but I'd like @carlossanlop to review too
Change "Theory" to "Fact" Co-authored-by: Eric StJohn <ericstj@microsoft.com>
|
@carlossanlop PTAL |
carlossanlop
left a comment
There was a problem hiding this comment.
LGTM. The condition makes sense and the test verifies the reported scenario.
|
/ba-g a lot of timeouts in different legs for which we already have dnceng issues |
Fixes #109167
This pull request fixes unexpected IndexOutOfRangeException in ZipArchive.
Additional check added that array index is not out of range.
It is done in a similar way to the code in HuffmanTree.c:230:
Found by Linux Verification Center (linuxtesting.org).