This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Fix netname2host
- From: Andreas Jaeger <aj at suse dot com>
- To: libc-alpha at sources dot redhat dot com
- Date: Thu, 29 Sep 2011 10:07:22 +0200
- Subject: Fix netname2host
I guess nobody ever used this function, I cannot work since it used an
uninitialized variable buffer instead of the parameter as input.
Here's a patch,
Andreas
2011-09-29 Andreas Jaeger <aj@suse.de>
[BZ#13179]
* sunrpc/netname.c (netname2host): Fix logic.
diff --git a/sunrpc/netname.c b/sunrpc/netname.c
index e1f1cf6..b5bfc519 100644
--- a/sunrpc/netname.c
+++ b/sunrpc/netname.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1997, 1998, 1999, 2002, 2007 Free Software Foundation, Inc.
+/* Copyright (C) 1997, 1998, 1999, 2002, 2007, 2011 Free Software Foundation,
Inc.
This file is part of the GNU C Library.
Contributed by Thorsten Kukuk <kukuk@vt.uni-paderborn.de>, 1997.
@@ -196,9 +196,8 @@ netname2host (const char netname[MAXNETNAMELEN + 1], char
*hostname,
const int hostlen)
{
char *p1, *p2;
- char buffer[MAXNETNAMELEN + 1];
- p1 = strchr (buffer, '.');
+ p1 = strchr (netname, '.');
if (p1 == NULL)
return 0;
p1++;
--
Andreas Jaeger aj@{suse.com,opensuse.org} Twitter/Identica: jaegerandi
SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 Nürnberg, Germany
GF: Jeff Hawn, Jennifer Guild, Felix Imendörffer, HRB 16746 (AG Nürnberg)
GPG fingerprint = 93A3 365E CE47 B889 DF7F FED1 389A 563C C272 A126