summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorreyk <reyk@openbsd.org>2010-05-14 11:11:10 +0000
committerreyk <reyk@openbsd.org>2010-05-14 11:11:10 +0000
commite8494736baa87088fec6cfd42977639dd073aee8 (patch)
tree921ce9fe46327a927737e8e923744de503afffca
parentFix ICE when checking a zero-size array for __bounded__ (TYPE_MAX_VALUE (diff)
downloadwireguard-openbsd-e8494736baa87088fec6cfd42977639dd073aee8.tar.xz
wireguard-openbsd-e8494736baa87088fec6cfd42977639dd073aee8.zip
zero out the allocate memory for a new control connection via calloc()
ok jsg@ gilles@
-rw-r--r--usr.sbin/relayd/control.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/usr.sbin/relayd/control.c b/usr.sbin/relayd/control.c
index bbcde386601..58bfb506102 100644
--- a/usr.sbin/relayd/control.c
+++ b/usr.sbin/relayd/control.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: control.c,v 1.35 2010/05/10 02:00:50 krw Exp $ */
+/* $OpenBSD: control.c,v 1.36 2010/05/14 11:11:10 reyk Exp $ */
/*
* Copyright (c) 2003, 2004 Henning Brauer <henning@openbsd.org>
@@ -142,7 +142,7 @@ control_accept(int listenfd, short event, void *arg)
session_socket_blockmode(connfd, BM_NONBLOCK);
- if ((c = malloc(sizeof(struct ctl_conn))) == NULL) {
+ if ((c = calloc(1, sizeof(struct ctl_conn))) == NULL) {
close(connfd);
log_warn("control_accept");
return;