svn commit: r303680 - stable/10/lib/libc/gen

Mark Johnston markj at FreeBSD.org
Tue Aug 2 21:17:35 UTC 2016


Author: markj
Date: Tue Aug  2 21:17:34 2016
New Revision: 303680
URL: https://svnweb.freebsd.org/changeset/base/303680

Log:
  MFC r301710:
  Fix an infinite loop in setnetgrent(3) with NIS netgroups.

Modified:
  stable/10/lib/libc/gen/getnetgrent.c
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/lib/libc/gen/getnetgrent.c
==============================================================================
--- stable/10/lib/libc/gen/getnetgrent.c	Tue Aug  2 20:56:00 2016	(r303679)
+++ stable/10/lib/libc/gen/getnetgrent.c	Tue Aug  2 21:17:34 2016	(r303680)
@@ -559,6 +559,10 @@ read_for_group(const char *group)
 					continue;
 				}
 			}
+			if (strlen(result) == 0) {
+				free(result);
+				return (NULL);
+			}
 			snprintf(line, LINSIZ, "%s %s", group, result);
 			free(result);
 		}


More information about the svn-src-stable-10 mailing list