Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/external/bsd/fetch/dist/libfetch avoid a strict aliasing pro...
details: https://anonhg.NetBSD.org/src/rev/a9a60792dd7d
branches: trunk
changeset: 790735:a9a60792dd7d
user: mrg <mrg%NetBSD.org@localhost>
date: Sat Oct 19 22:58:40 2013 +0000
description:
avoid a strict aliasing problem copying the mapped v4 address out of
a ipv6 address.
diffstat:
external/bsd/fetch/dist/libfetch/ftp.c | 6 ++++--
1 files changed, 4 insertions(+), 2 deletions(-)
diffs (27 lines):
diff -r 4abeb913c490 -r a9a60792dd7d external/bsd/fetch/dist/libfetch/ftp.c
--- a/external/bsd/fetch/dist/libfetch/ftp.c Sat Oct 19 22:57:46 2013 +0000
+++ b/external/bsd/fetch/dist/libfetch/ftp.c Sat Oct 19 22:58:40 2013 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: ftp.c,v 1.5 2011/08/17 09:19:38 christos Exp $ */
+/* $NetBSD: ftp.c,v 1.6 2013/10/19 22:58:40 mrg Exp $ */
/*-
* Copyright (c) 1998-2004 Dag-Erling Coïdan Smørgrav
* Copyright (c) 2008, 2009, 2010 Joerg Sonnenberger <joerg%NetBSD.org@localhost>
@@ -138,6 +138,7 @@
unmappedaddr(struct sockaddr_in6 *sin6, socklen_t *len)
{
struct sockaddr_in *sin4;
+ void *addrp;
uint32_t addr;
int port;
@@ -145,7 +146,8 @@
!IN6_IS_ADDR_V4MAPPED(&sin6->sin6_addr))
return;
sin4 = (struct sockaddr_in *)(void *)sin6;
- addr = *(uint32_t *)(void *)&sin6->sin6_addr.s6_addr[12];
+ addrp = &sin6->sin6_addr.s6_addr[12];
+ addr = *(uint32_t *)addrp;
port = sin6->sin6_port;
memset(sin4, 0, sizeof(struct sockaddr_in));
sin4->sin_addr.s_addr = addr;
Home |
Main Index |
Thread Index |
Old Index