[PATCH] Fix gaiconf_init

Jakub Jelinek jakub@redhat.com
Tue May 30 16:12:00 GMT 2006


Hi!

If precedence has no / in val1 string, bits will be uninitialized,
as goto new_elem will jump into the block after bits initialization.

2006-05-30  Jakub Jelinek  <jakub@redhat.com>

	* sysdeps/posix/getaddrinfo.c (gaiconf_init): Initialize bits
	to 128 after new_elem label.

--- libc/sysdeps/posix/getaddrinfo.c.jj	2006-05-29 16:28:08.000000000 +0200
+++ libc/sysdeps/posix/getaddrinfo.c	2006-05-30 18:05:35.000000000 +0200
@@ -1668,7 +1668,7 @@ gaiconf_init (void)
 	      if (strcmp (cmd, "label") == 0)
 		{
 		  struct in6_addr prefix;
-		  unsigned long int bits = 128;
+		  unsigned long int bits;
 		  unsigned long int val;
 		  char *endp;
 
@@ -1677,6 +1677,7 @@ gaiconf_init (void)
 		  nullbitsp = &labellist_nullbits;
 
 		new_elem:
+		  bits = 128;
 		  __set_errno (0);
 		  cp = strchr (val1, '/');
 		  if (cp != NULL)

	Jakub



More information about the Libc-hacker mailing list