n-api: fix use-after-free with napi_remove_async_cleanup_hook by addaleax · Pull Request #34662 · nodejs/node

@nodejs-github-bot added c++

Issues and PRs that require attention from people who are familiar with C++.

node-api

Issues and PRs related to the Node-API.

labels

Aug 7, 2020
Only decrease the size when actually removing items.
This allows using `SetImmediate()` and friends at any point
during cleanup.

@addaleax

gabrielschulhof

@jasnell jasnell added the author ready

PRs that have at least one approval, no pending requests for changes, and a CI started.

label

Aug 7, 2020

jasnell pushed a commit that referenced this pull request

Aug 7, 2020
Only decrease the size when actually removing items.

PR-URL: #34662
Fixes: #34657
Refs: #34572
Reviewed-By: Gabriel Schulhof <gabriel.schulhof@intel.com>
Reviewed-By: James M Snell <jasnell@gmail.com>

jasnell pushed a commit that referenced this pull request

Aug 7, 2020
This allows using `SetImmediate()` and friends at any point
during cleanup.

PR-URL: #34662
Fixes: #34657
Refs: #34572
Reviewed-By: Gabriel Schulhof <gabriel.schulhof@intel.com>
Reviewed-By: James M Snell <jasnell@gmail.com>

jasnell pushed a commit that referenced this pull request

Aug 7, 2020
Fixes: #34657
Refs: #34572

PR-URL: #34662
Reviewed-By: Gabriel Schulhof <gabriel.schulhof@intel.com>
Reviewed-By: James M Snell <jasnell@gmail.com>

This was referenced

Aug 8, 2020

addaleax added a commit that referenced this pull request

Aug 8, 2020
Only decrease the size when actually removing items.

PR-URL: #34662
Fixes: #34657
Refs: #34572
Reviewed-By: Gabriel Schulhof <gabriel.schulhof@intel.com>
Reviewed-By: James M Snell <jasnell@gmail.com>

addaleax added a commit that referenced this pull request

Aug 8, 2020
This allows using `SetImmediate()` and friends at any point
during cleanup.

PR-URL: #34662
Fixes: #34657
Refs: #34572
Reviewed-By: Gabriel Schulhof <gabriel.schulhof@intel.com>
Reviewed-By: James M Snell <jasnell@gmail.com>

addaleax added a commit that referenced this pull request

Aug 8, 2020
Fixes: #34657
Refs: #34572

PR-URL: #34662
Reviewed-By: Gabriel Schulhof <gabriel.schulhof@intel.com>
Reviewed-By: James M Snell <jasnell@gmail.com>

This was referenced

Aug 9, 2020

codebytere pushed a commit that referenced this pull request

Aug 11, 2020
Only decrease the size when actually removing items.

PR-URL: #34662
Fixes: #34657
Refs: #34572
Reviewed-By: Gabriel Schulhof <gabriel.schulhof@intel.com>
Reviewed-By: James M Snell <jasnell@gmail.com>

codebytere pushed a commit that referenced this pull request

Aug 11, 2020
This allows using `SetImmediate()` and friends at any point
during cleanup.

PR-URL: #34662
Fixes: #34657
Refs: #34572
Reviewed-By: Gabriel Schulhof <gabriel.schulhof@intel.com>
Reviewed-By: James M Snell <jasnell@gmail.com>

codebytere pushed a commit that referenced this pull request

Aug 11, 2020
Fixes: #34657
Refs: #34572

PR-URL: #34662
Reviewed-By: Gabriel Schulhof <gabriel.schulhof@intel.com>
Reviewed-By: James M Snell <jasnell@gmail.com>

This was referenced

Aug 12, 2020

addaleax added a commit that referenced this pull request

Sep 22, 2020
Only decrease the size when actually removing items.

PR-URL: #34662
Fixes: #34657
Refs: #34572
Reviewed-By: Gabriel Schulhof <gabriel.schulhof@intel.com>
Reviewed-By: James M Snell <jasnell@gmail.com>

addaleax added a commit that referenced this pull request

Sep 22, 2020
This allows using `SetImmediate()` and friends at any point
during cleanup.

PR-URL: #34662
Fixes: #34657
Refs: #34572
Reviewed-By: Gabriel Schulhof <gabriel.schulhof@intel.com>
Reviewed-By: James M Snell <jasnell@gmail.com>

addaleax added a commit that referenced this pull request

Sep 22, 2020
Only decrease the size when actually removing items.

PR-URL: #34662
Fixes: #34657
Refs: #34572
Reviewed-By: Gabriel Schulhof <gabriel.schulhof@intel.com>
Reviewed-By: James M Snell <jasnell@gmail.com>

addaleax added a commit that referenced this pull request

Sep 22, 2020
This allows using `SetImmediate()` and friends at any point
during cleanup.

PR-URL: #34662
Fixes: #34657
Refs: #34572
Reviewed-By: Gabriel Schulhof <gabriel.schulhof@intel.com>
Reviewed-By: James M Snell <jasnell@gmail.com>

addaleax added a commit that referenced this pull request

Sep 22, 2020
Fixes: #34657
Refs: #34572

PR-URL: #34662
Reviewed-By: Gabriel Schulhof <gabriel.schulhof@intel.com>
Reviewed-By: James M Snell <jasnell@gmail.com>