mirror of
https://github.com/zebrajr/node.git
synced 2025-12-06 12:20:27 +01:00
src: use sizeof(var) instead of sizeof(type)
Change `memset(&s, 0, sizeof(type))` to `memset(&s, 0, sizeof(s))`. The former is dangerous when the type of `s` changes. PR-URL: https://github.com/nodejs/node/pull/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>
This commit is contained in:
parent
2f1da92052
commit
a21bee77ef
|
|
@ -1969,7 +1969,7 @@ void GetAddrInfo(const FunctionCallbackInfo<Value>& args) {
|
|||
args[4]->IsTrue());
|
||||
|
||||
struct addrinfo hints;
|
||||
memset(&hints, 0, sizeof(struct addrinfo));
|
||||
memset(&hints, 0, sizeof(hints));
|
||||
hints.ai_family = family;
|
||||
hints.ai_socktype = SOCK_STREAM;
|
||||
hints.ai_flags = flags;
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user