Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 2 Aug 2016 21:17:34 +0000 (UTC)
From:      Mark Johnston <markj@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org
Subject:   svn commit: r303680 - stable/10/lib/libc/gen
Message-ID:  <201608022117.u72LHYII025879@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
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);
 		}



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201608022117.u72LHYII025879>