Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

(v4.x-backport) zlib: fix crash when initializing failed #14860

Closed
wants to merge 2 commits into from

Commits on Aug 16, 2017

  1. zlib: fix node crashing on invalid options

    This is a partial backport of semver-patch bits of
    9e4660b.
    
    This commit fixes the Node process crashing when constructors of classes
    of the zlib module are given invalid options.
    
    * Throw an Error when the zlib library rejects the value of windowBits,
      instead of crashing with an assertion.
    
    * Treat windowBits and memLevel options consistently with other ones and
      don't crash when non-numeric values are given.
    
    PR-URL: nodejs#13098
    Fixes: nodejs#13082
    Reviewed-By: Anna Henningsen <[email protected]>
    Reviewed-By: Colin Ihrig <[email protected]>
    Reviewed-By: Luigi Pinca <[email protected]>
    Reviewed-By: Sakthipriyan Vairamani <[email protected]>
    aqrln committed Aug 16, 2017
    Configuration menu
    Copy the full SHA
    ebbcbc6 View commit details
    Browse the repository at this point in the history
  2. zlib: fix crash when initializing failed

    Unset `mode_` when initializing the zlib stream failed, so that
    we don’t try to call the zlib end functions (`deflateEnd()` etc.)
    when cleaning up in `ZCtx::Close()`.
    
    Fixes: nodejs#14178
    Ref: nodejs#13098
    PR-URL: nodejs#14666
    Reviewed-By: Refael Ackermann <[email protected]>
    Reviewed-By: Colin Ihrig <[email protected]>
    Reviewed-By: Alexey Orlenko <[email protected]>
    addaleax authored and aqrln committed Aug 16, 2017
    Configuration menu
    Copy the full SHA
    38316ff View commit details
    Browse the repository at this point in the history