bugzilla-daemon at bugzilla.mindrot.org
2010-Sep-23 02:04 UTC
[Bug 1825] New: ipv64_normalise_mapped()'s memset should use a4, not addr, for clarity
https://bugzilla.mindrot.org/show_bug.cgi?id=1825
Summary: ipv64_normalise_mapped()'s memset should use a4, not
addr, for clarity
Product: Portable OpenSSH
Version: 5.6p1
Platform: All
OS/Version: All
Status: NEW
Severity: trivial
Priority: P2
Component: Miscellaneous
AssignedTo: unassigned-bugs at mindrot.org
ReportedBy: foo at mailinator.com
The current code in "canohost.c" looks like this:
void
ipv64_normalise_mapped(struct sockaddr_storage *addr, socklen_t *len)
{
struct sockaddr_in6 *a6 = (struct sockaddr_in6 *)addr;
struct sockaddr_in *a4 = (struct sockaddr_in *)addr;
...
memset(addr, 0, sizeof(*a4));
That last line has the correct behavior, but it would help with static
analysis and compiler diagnostics if it were written as:
memset(a4, 0, sizeof(*a4));
A compiler here unnamed gives a warning on the unmodified line, because
it sees that *addr is not the same size as *a4 and therefore the
memset() might be setting the "wrong" number of bytes. If we change
the code to use a4 consistently when referring to an IPv4 sockaddr, the
compiler is happier, and incidentally the code's correctness is more
obvious, too.
--
Configure bugmail: https://bugzilla.mindrot.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are watching the assignee of the bug.
bugzilla-daemon at bugzilla.mindrot.org
2010-Oct-12 02:24 UTC
[Bug 1825] ipv64_normalise_mapped()'s memset should use a4, not addr, for clarity
https://bugzilla.mindrot.org/show_bug.cgi?id=1825 --- Comment #1 from Damien Miller <djm at mindrot.org> 2010-10-12 13:24:18 EST --- Created attachment 1933 --> https://bugzilla.mindrot.org/attachment.cgi?id=1933 /home/djm/canohost-warnfix.diff -- Configure bugmail: https://bugzilla.mindrot.org/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are watching the assignee of the bug.
bugzilla-daemon at bugzilla.mindrot.org
2010-Oct-12 02:29 UTC
[Bug 1825] ipv64_normalise_mapped()'s memset should use a4, not addr, for clarity
https://bugzilla.mindrot.org/show_bug.cgi?id=1825
Damien Miller <djm at mindrot.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |djm at mindrot.org
Blocks| |1803
Status|NEW |RESOLVED
Resolution| |FIXED
--- Comment #2 from Damien Miller <djm at mindrot.org> 2010-10-12 13:29:07
EST ---
Patch applied - thanks.
--
Configure bugmail: https://bugzilla.mindrot.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are watching the assignee of the bug.
You are watching someone on the CC list of the bug.
bugzilla-daemon at bugzilla.mindrot.org
2010-Oct-12 02:29 UTC
[Bug 1825] ipv64_normalise_mapped()'s memset should use a4, not addr, for clarity
https://bugzilla.mindrot.org/show_bug.cgi?id=1825
Darren Tucker <dtucker at zip.com.au> changed:
What |Removed |Added
----------------------------------------------------------------------------
Attachment #1933| |ok+
Flags| |
--
Configure bugmail: https://bugzilla.mindrot.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are watching the assignee of the bug.
You are watching someone on the CC list of the bug.
bugzilla-daemon at bugzilla.mindrot.org
2011-Jan-24 01:34 UTC
[Bug 1825] ipv64_normalise_mapped()'s memset should use a4, not addr, for clarity
https://bugzilla.mindrot.org/show_bug.cgi?id=1825
Damien Miller <djm at mindrot.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|RESOLVED |CLOSED
--- Comment #3 from Damien Miller <djm at mindrot.org> 2011-01-24 12:34:07
EST ---
Move resolved bugs to CLOSED after 5.7 release
--
Configure bugmail: https://bugzilla.mindrot.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are watching the assignee of the bug.
You are watching someone on the CC list of the bug.