From: yasuoka Date: Wed, 7 May 2014 08:07:53 +0000 (+0000) Subject: Initialize struct iface by zero. Without this, npppd had used random X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=c3f3f34f448b55c770b6f9b6955e886f47c8a275;p=openbsd Initialize struct iface by zero. Without this, npppd had used random configuration. from Anders Berggren. --- diff --git a/usr.sbin/npppd/npppd/parse.y b/usr.sbin/npppd/npppd/parse.y index 66c7c89152d..0238acffea3 100644 --- a/usr.sbin/npppd/npppd/parse.y +++ b/usr.sbin/npppd/npppd/parse.y @@ -1,4 +1,4 @@ -/* $OpenBSD: parse.y,v 1.10 2014/05/05 04:58:23 yasuoka Exp $ */ +/* $OpenBSD: parse.y,v 1.11 2014/05/07 08:07:53 yasuoka Exp $ */ /* * Copyright (c) 2002, 2003, 2004 Henning Brauer @@ -874,7 +874,7 @@ interface : INTERFACE STRING ADDRESS in4_addr IPCP STRING { YYERROR; } - if ((n = malloc(sizeof(struct iface))) == NULL) { + if ((n = calloc(1, sizeof(struct iface))) == NULL) { yyerror("out of memory"); free($2); YYERROR;