[git commit 0.9.31] resolv: tentatively fix usage of uninitialized DNS parameters
Denys Vlasenko
vda.linux at googlemail.com
Mon Apr 12 13:09:25 UTC 2010
commit: http://git.uclibc.org/uClibc/commit/?id=850da1f578f7694e6ed41008db346c14f4f89f3b
branch: http://git.uclibc.org/uClibc/commit/?id=refs/heads/0.9.31
See "Possible regression from timeout commit for resolv.conf" thread.
Also remove superfluous NULL check.
Signed-off-by: Denys Vlasenko <vda.linux at googlemail.com>
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop at gmail.com>
---
libc/inet/resolv.c | 6 ++----
1 files changed, 2 insertions(+), 4 deletions(-)
diff --git a/libc/inet/resolv.c b/libc/inet/resolv.c
index 9459199..84289a6 100644
--- a/libc/inet/resolv.c
+++ b/libc/inet/resolv.c
@@ -905,8 +905,8 @@ __UCLIBC_MUTEX_INIT(__resolv_lock, PTHREAD_MUTEX_INITIALIZER);
/* Protected by __resolv_lock */
void (*__res_sync)(void);
/*uint32_t __resolv_opts; */
-uint8_t __resolv_timeout;
-uint8_t __resolv_attempts;
+uint8_t __resolv_timeout = RES_TIMEOUT;
+uint8_t __resolv_attempts = RES_DFLRETRY;
unsigned __nameservers;
unsigned __searchdomains;
sockaddr46_t *__nameserver;
@@ -1062,8 +1062,6 @@ void attribute_hidden __open_nameservers(void)
if (p == NULL || (p1 = strchr(p, ':')) == NULL)
continue;
*p1++ = '\0';
- if (p1 == NULL)
- continue;
if (strcmp(p, "timeout") == 0)
what = &__resolv_timeout;
else if (strcmp(p, "attempts") == 0)
--
1.6.3.3
More information about the uClibc-cvs
mailing list