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

src: use sizeof(var) instead of sizeof(type) #27038

Closed
wants to merge 1 commit into from

Conversation

bnoordhuis
Copy link
Member

Change memset(&s, 0, sizeof(type)) to memset(&s, 0, sizeof(s)).
The former is dangerous when the type of s changes.

Change `memset(&s, 0, sizeof(type))` to `memset(&s, 0, sizeof(s))`.
The former is dangerous when the type of `s` changes.
@nodejs-github-bot
Copy link
Collaborator

@nodejs-github-bot nodejs-github-bot added c++ Issues and PRs that require attention from people who are familiar with C++. cares Issues and PRs related to the c-ares dependency or the cares_wrap binding. labels Apr 1, 2019
@BridgeAR BridgeAR added the author ready PRs that have at least one approval, no pending requests for changes, and a CI started. label Apr 3, 2019
@nodejs-github-bot
Copy link
Collaborator

@danbev
Copy link
Contributor

danbev commented Apr 4, 2019

Re-build of failing node-test-commit-freebsd (✔️)

@danbev
Copy link
Contributor

danbev commented Apr 4, 2019

Landed in adbcda1.

@danbev danbev closed this Apr 4, 2019
danbev pushed a commit that referenced this pull request Apr 4, 2019
Change `memset(&s, 0, sizeof(type))` to `memset(&s, 0, sizeof(s))`.
The former is dangerous when the type of `s` changes.

PR-URL: #27038
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Santiago Gimeno <santiago.gimeno@gmail.com>
BethGriggs pushed a commit that referenced this pull request Apr 4, 2019
Change `memset(&s, 0, sizeof(type))` to `memset(&s, 0, sizeof(s))`.
The former is dangerous when the type of `s` changes.

PR-URL: #27038
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Santiago Gimeno <santiago.gimeno@gmail.com>
BethGriggs pushed a commit that referenced this pull request Apr 9, 2019
Change `memset(&s, 0, sizeof(type))` to `memset(&s, 0, sizeof(s))`.
The former is dangerous when the type of `s` changes.

PR-URL: #27038
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Santiago Gimeno <santiago.gimeno@gmail.com>
Signed-off-by: Beth Griggs <Bethany.Griggs@uk.ibm.com>
@BethGriggs BethGriggs mentioned this pull request Apr 9, 2019
BethGriggs pushed a commit that referenced this pull request Apr 10, 2019
Change `memset(&s, 0, sizeof(type))` to `memset(&s, 0, sizeof(s))`.
The former is dangerous when the type of `s` changes.

PR-URL: #27038
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Santiago Gimeno <santiago.gimeno@gmail.com>
Signed-off-by: Beth Griggs <Bethany.Griggs@uk.ibm.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
author ready PRs that have at least one approval, no pending requests for changes, and a CI started. c++ Issues and PRs that require attention from people who are familiar with C++. cares Issues and PRs related to the c-ares dependency or the cares_wrap binding.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants