Skip to content
Snippets Groups Projects
  • Hans Wennborg's avatar
    [zlib] Add streaming inflate fuzzer · 493d4299
    Hans Wennborg authored
    This adds a new fuzzer which first deflates and then inflates some data
    one chunk at a time and verifies that it round-trips correctly. It's
    targeted at the recent bug where inffast_chunk was called with
    overlapping from and out buffers.
    
    I've verified that the fuzzer detects the incorrect inflate results when
    using Clang's -basic-aa-recphi option before the bug fix in e0f88a9.
    
    Furthermore, this patch adds asserts in inffast_chunk and other
    functions that verify there's no overlap of restrict-qualified buffers.
    (I've checked that the fuzzer hits the inffast_chunk assert before
    e0f88a9).
    
    To make those asserts work, this changes the build config to define
    ZLIB_DEBUG in debug and fuzzer builds.
    
    Bug: 1103818, 708726
    Change-Id: Ia3d5e7906b8b1a65d56a589d8a81d17661e638c2
    Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2332705
    
    
    Commit-Queue: Hans Wennborg <hans@chromium.org>
    Reviewed-by: default avatarNico Weber <thakis@chromium.org>
    Reviewed-by: default avatarAdenilson Cavalcanti <cavalcantii@chromium.org>
    Cr-Original-Commit-Position: refs/heads/master@{#794482}
    Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src
    Cr-Mirrored-Commit: 3eda17e22e6a3c4e44fdfa778b7d55f0a7c82e75
    493d4299