[PATCH] map_v4v6_address

Jakub Jelinek jakub@redhat.com
Tue Nov 21 12:18:00 GMT 2006


Hi!

src is const char * (and furthermore not necessarily equal to dst).
I wonder if you don't want to copy to dst + 12 (or p + 12, which is
the same thing) instead.

2006-10-21  Jakub Jelinek  <jakub@redhat.com>

	* resolv/mapv4v6addr.h (map_v4v6_address): Fix last change.

--- libc/resolv/mapv4v6addr.h.jj	2006-11-21 13:08:02.000000000 +0100
+++ libc/resolv/mapv4v6addr.h	2006-11-21 13:10:02.000000000 +0100
@@ -59,7 +59,7 @@ map_v4v6_address (const char *src, char 
   int i;
 
   /* Move the IPv4 part to the right position.  */
-  memcpy (src + 12, src, INADDRSZ);
+  memcpy (dst + 12, src, INADDRSZ);
 
   /* Mark this ipv6 addr as a mapped ipv4. */
   for (i = 0; i < 10; i++)

	Jakub



More information about the Libc-hacker mailing list