This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]