This is the mail archive of the libc-hacker@sources.redhat.com mailing list for the glibc project.

Note that libc-hacker is a closed list. You may look at the archives of this list, but subscription and posting are not open.


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

[PATCH] Fix segv in nss_files


Hi!

With multi on in /etc/host.conf and lines like:
1.2.3.4 x
1.2.3.4 x y
in /etc/hosts gethostbyname segfaults (a while loop in HOST_DB_LOOKUP loops
forever because cnt is never incremented).
Fixed by following patch.

2000-09-02  Jakub Jelinek  <jakub@redhat.com>

	* nss/nss_files/files-hosts.c (HOST_DB_LOOKUP): Increment counter in
	the loop.

--- libc/nss/nss_files/files-hosts.c.jj	Thu Jul 27 15:59:38 2000
+++ libc/nss/nss_files/files-hosts.c	Sat Sep  2 23:19:11 2000
@@ -200,6 +200,7 @@ _nss_files_get##name##_r (proto,					   
 		      bufferend = (__stpcpy (bufferend,			      \
 					     tmp_result_buf.h_aliases[cnt])   \
 				   + 1);				      \
+		      ++cnt;						      \
 		    }							      \
 									      \
 		  if (cnt < newaliases)					      \

	Jakub

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