From c3f3f34f448b55c770b6f9b6955e886f47c8a275 Mon Sep 17 00:00:00 2001 From: yasuoka Date: Wed, 7 May 2014 08:07:53 +0000 Subject: [PATCH] Initialize struct iface by zero. Without this, npppd had used random configuration. from Anders Berggren. --- usr.sbin/npppd/npppd/parse.y | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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; -- 2.20.1