summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYASUOKA Masahiko <yasuoka@cvs.openbsd.org>2014-05-07 08:07:54 +0000
committerYASUOKA Masahiko <yasuoka@cvs.openbsd.org>2014-05-07 08:07:54 +0000
commit46e7f809788fbeffddf88d450c92fe6c402666a6 (patch)
treeaae4a8c234ee0bf71b8a047cff7273178fd729f8
parenta962044eb5d5f8dc75e10167e2092fe311d99026 (diff)
Initialize struct iface by zero. Without this, npppd had used random
configuration. from Anders Berggren.
-rw-r--r--usr.sbin/npppd/npppd/parse.y4
1 files 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 <henning@openbsd.org>
@@ -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;