svn commit: r303681 - stable/9/lib/libc/gen

Mark Johnston markj at FreeBSD.org
Tue Aug 2 21:18:00 UTC 2016


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

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

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

Modified: stable/9/lib/libc/gen/getnetgrent.c
==============================================================================
--- stable/9/lib/libc/gen/getnetgrent.c	Tue Aug  2 21:17:34 2016	(r303680)
+++ stable/9/lib/libc/gen/getnetgrent.c	Tue Aug  2 21:17:59 2016	(r303681)
@@ -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-9 mailing list