public inbox for libc-hacker@sourceware.org
 help / color / mirror / Atom feed
* [PATCH] Fix gaiconf_init
@ 2006-05-30 16:12 Jakub Jelinek
  0 siblings, 0 replies; only message in thread
From: Jakub Jelinek @ 2006-05-30 16:12 UTC (permalink / raw)
  To: Ulrich Drepper, Roland McGrath; +Cc: Glibc hackers

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

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2006-05-30 16:12 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-05-30 16:12 [PATCH] Fix gaiconf_init Jakub Jelinek

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).