Skip to content
This repository has been archived by the owner on Oct 15, 2020. It is now read-only.

deps: fix libuv registry API error handling #517

Merged
merged 2 commits into from
Apr 22, 2018

Conversation

kfarnung
Copy link
Contributor

@kfarnung kfarnung commented Apr 20, 2018

The Reg* APIs on Windows don't use GetLastError to report failures.
The errors are returned directly from the call.

For systems which don't have one of the values GetLastError can end
up returning 0 to the caller, indicating success. The caller then
assumes that the data is valid and can attempt to execute on garbage
data. This change fixes the flow to correctly return the error to the
caller.

Checklist
  • make -j4 test (UNIX), or vcbuild test (Windows) passes
  • commit message follows commit guidelines

@kfarnung kfarnung self-assigned this Apr 20, 2018
@kfarnung kfarnung changed the title src: initialize values to improve safety deps: fix libuv registry API error handling Apr 20, 2018
@kfarnung
Copy link
Contributor Author

kfarnung commented Apr 21, 2018

@kfarnung
Copy link
Contributor Author

Upstream PR: libuv/libuv#1811

Copy link
Contributor

@sethbrenith sethbrenith left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:shipit:

@kfarnung kfarnung force-pushed the armcrash branch 5 times, most recently from 3c3de2a to f877277 Compare April 22, 2018 06:59
kfarnung added a commit to kfarnung/node-chakracore that referenced this pull request Apr 22, 2018
The `Reg*` APIs on Windows don't use `GetLastError` to report failures.
The errors are returned directly from the call.

For systems which don't have one of the values `GetLastError` can end
up returning `0` to the caller, indicating success. The caller then
assumes that the data is valid and can attempt to execute on garbage
data. This change fixes the flow to correctly return the error to the
caller.

Upstream-PR: libuv/libuv#1811
PR-URL: nodejs#517
Reviewed-By: Seth Brenith <[email protected]>
@kfarnung
Copy link
Contributor Author

The `Reg*` APIs on Windows don't use `GetLastError` to report failures.
The errors are returned directly from the call.

For systems which don't have one of the values `GetLastError` can end
up returning `0` to the caller, indicating success. The caller then
assumes that the data is valid and can attempt to execute on garbage
data. This change fixes the flow to correctly return the error to the
caller.

Upstream-PR: libuv/libuv#1811
PR-URL: nodejs#517
Reviewed-By: Seth Brenith <[email protected]>
@kfarnung kfarnung merged commit e1f8119 into nodejs:master Apr 22, 2018
kfarnung added a commit that referenced this pull request Apr 22, 2018
The `Reg*` APIs on Windows don't use `GetLastError` to report failures.
The errors are returned directly from the call.

For systems which don't have one of the values `GetLastError` can end
up returning `0` to the caller, indicating success. The caller then
assumes that the data is valid and can attempt to execute on garbage
data. This change fixes the flow to correctly return the error to the
caller.

Upstream-PR: libuv/libuv#1811
PR-URL: #517
Reviewed-By: Seth Brenith <[email protected]>
kfarnung added a commit that referenced this pull request Apr 22, 2018
@kfarnung kfarnung deleted the armcrash branch April 22, 2018 16:16
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants