From: millert Date: Fri, 16 May 2014 17:30:28 +0000 (+0000) Subject: Zero out grp before re-using it (new ones are already cleared by X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=86445948da4b03a0b6fa3494f5ac7b80af6a7263;p=openbsd Zero out grp before re-using it (new ones are already cleared by calloc). We only reuse grp when there is an unresolvable host. Fixes a bug where if a host in a netgroup is unresolvable then entire netgroup is ignore. OK krw@ --- diff --git a/sbin/mountd/mountd.c b/sbin/mountd/mountd.c index 92bbd2339b2..b7adff22fc8 100644 --- a/sbin/mountd/mountd.c +++ b/sbin/mountd/mountd.c @@ -1,4 +1,4 @@ -/* $OpenBSD: mountd.c,v 1.74 2014/04/22 20:25:16 tedu Exp $ */ +/* $OpenBSD: mountd.c,v 1.75 2014/05/16 17:30:28 millert Exp $ */ /* $NetBSD: mountd.c,v 1.31 1996/02/18 11:57:53 fvdl Exp $ */ /* @@ -875,6 +875,8 @@ get_exportlist(void) if (has_host) { grp->gr_next = get_grp(); grp = grp->gr_next; + } else { + memset(grp, 0, sizeof(*grp)); } if (netgrp) { if (hst == NULL) {