From 297060f42d5189a4065ea1b6f0afdf6371fb0507 Mon Sep 17 00:00:00 2001 From: "dtucker@openbsd.org" Date: Fri, 8 May 2015 03:25:07 +0000 Subject: [PATCH] upstream commit Use xcalloc for permitted_adm_opens instead of xmalloc to ensure it's zeroed. Fixes post-auth crash with permitopen=none. bz#2355, ok djm@ --- channels.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/channels.c b/channels.c index f72b8cc62..b0b1c58dd 100644 --- a/channels.c +++ b/channels.c @@ -1,4 +1,4 @@ -/* $OpenBSD: channels.c,v 1.342 2015/04/24 01:36:00 deraadt Exp $ */ +/* $OpenBSD: channels.c,v 1.343 2015/05/08 03:25:07 dtucker Exp $ */ /* * Author: Tatu Ylonen * Copyright (c) 1995 Tatu Ylonen , Espoo, Finland @@ -3533,7 +3533,7 @@ void channel_disable_adm_local_opens(void) { channel_clear_adm_permitted_opens(); - permitted_adm_opens = xmalloc(sizeof(*permitted_adm_opens)); + permitted_adm_opens = xcalloc(sizeof(*permitted_adm_opens), 1); permitted_adm_opens[num_adm_permitted_opens].host_to_connect = NULL; num_adm_permitted_opens = 1; }