Closed
Bug 1330490
Opened 6 years ago
Closed 6 years ago
memset 0 of the entire PRNetAddr in PR_InitializeNetAddr
Categories
(NSPR :: NSPR, defect)
NSPR
NSPR
Tracking
(Not tracked)
RESOLVED
FIXED
4.15
People
(Reporter: schien, Assigned: schien)
References
Details
Attachments
(1 file, 1 obsolete file)
1.03 KB,
patch
|
Details | Diff | Splinter Review |
PR_InitializeNetAddr only memset 0 for ipv4 struct. We should clear the entire PRNetAddr for supporting ipv6 as well. See bug 1326483 comment #24 for the detail.
Comment hidden (mozreview-request) |
Comment 2•6 years ago
|
||
I confirm that this fixes the problem I found in bug 1333185. BTW I think that PR_InitializeNetAddr() needs the IP address family as an input, because even though this properly memset's the struct now it still then does everything based on the AF_INET (even when that is the wrong address family). But that is probably for another ticket to fix.
Blocks: 1333185
Comment 3•6 years ago
|
||
mozreview-review |
Comment on attachment 8826072 [details] Bug 1330490 - clear entire PRNetAddr struct in PR_InitializeNetAddr for IPv6. https://reviewboard.mozilla.org/r/104122/#review110708 ::: nsprpub/pr/src/misc/prnetdb.c:1408 (Diff revision 1) > PRNetAddrValue val, PRUint16 port, PRNetAddr *addr) > { > PRStatus rv = PR_SUCCESS; > if (!_pr_initialized) _PR_ImplicitInitialization(); > > - if (val != PR_IpAddrNull) memset(addr, 0, sizeof(addr->inet)); > + if (val != PR_IpAddrNull) memset(addr, 0, sizeof(*addr)); I don't *think* this should cause any problems, but I was looking at the history here, and there are some comments on bug 54796 that are a little concerning. I'm not sure they're still relevant nowadays, though.
Attachment #8826072 -
Flags: review?(ted) → review+
Assignee | ||
Comment 4•6 years ago
|
||
I double checked the current mozilla-central and doesn't found any code that passes sockaddr_in to PR_InitializedNetAddr. I'm not sure about the proper way to move this bug forward since NSPR is a shared library to many project. Do I simply land this bug via mozreview?
Flags: needinfo?(ted)
Assignee | ||
Updated•6 years ago
|
Keywords: checkin-needed
Assignee | ||
Comment 6•6 years ago
|
||
Need someone to land this patch on nspr repo. @ted can you help?
Flags: needinfo?(ted)
Attachment #8836592 -
Flags: checked-in?
Assignee | ||
Comment 7•6 years ago
|
||
@kaie can you help merge this patch to NSPR repo?
Flags: needinfo?(kaie)
Comment 8•6 years ago
|
||
https://hg.mozilla.org/projects/nspr/rev/2f1bfbcc79baac751f8bd83a9f799f33366b8d3a
Status: NEW → RESOLVED
Closed: 6 years ago
Flags: needinfo?(ted)
Flags: needinfo?(kaie)
Resolution: --- → FIXED
Target Milestone: --- → 4.14
Assignee | ||
Updated•6 years ago
|
Attachment #8836592 -
Flags: checked-in?
Updated•6 years ago
|
Keywords: checkin-needed
Updated•6 years ago
|
Target Milestone: 4.14 → 4.15
Assignee | ||
Updated•5 years ago
|
Attachment #8826072 -
Attachment is obsolete: true
You need to log in
before you can comment on or make changes to this bug.
Description
•