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

[v12.x] http: fix crash for sync write errors during header parsing #34251

Closed
wants to merge 3 commits into from

Commits on Jul 7, 2020

  1. http: fix crash for sync write errors during header parsing

    Fix a crash that occurs when `parser.finish()` is called during
    `parser.execute()`. In this particular case, this happened because
    a 100 continue response is a place in which `.end()` can be called
    which can in turn lead to a write error, which is emitted
    synchronously, thus inside the outer `parser.execute()` call.
    
    Resolve that by delaying the `parser.finish()` call until after
    the `parser.execute()` call is done.
    
    This only affects v12.x, because on later versions, errors are not
    emitted synchronously.
    
    Fixes: nodejs#15102
    addaleax committed Jul 7, 2020
    Configuration menu
    Copy the full SHA
    d9220ae View commit details
    Browse the repository at this point in the history
  2. test: add regression tests for HTTP parser crash

    Since the tests only crash on v12.x, this commit adds separate
    regression tests.
    
    Refs: nodejs#15102
    addaleax committed Jul 7, 2020
    Configuration menu
    Copy the full SHA
    11406b9 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    f30da15 View commit details
    Browse the repository at this point in the history