From b15aba8753dd77a8c5ea236266cbad25addd8d5a Mon Sep 17 00:00:00 2001 From: deraadt Date: Mon, 3 Apr 2017 17:07:58 +0000 Subject: [PATCH] use recallocarray() because the array contains data that can be observed --- libexec/comsat/comsat.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/libexec/comsat/comsat.c b/libexec/comsat/comsat.c index 6f75736e580..ef9a0b4d18e 100644 --- a/libexec/comsat/comsat.c +++ b/libexec/comsat/comsat.c @@ -1,4 +1,4 @@ -/* $OpenBSD: comsat.c,v 1.46 2017/04/02 00:53:37 guenther Exp $ */ +/* $OpenBSD: comsat.c,v 1.47 2017/04/03 17:07:58 deraadt Exp $ */ /* * Copyright (c) 1980, 1993 @@ -186,7 +186,8 @@ doreadutmp(void) sizeof(struct utmp); struct utmp *u; - if ((u = realloc(utmp, nutmpsize)) == NULL) { + if ((u = recallocarray(utmp, utmpsize, + nutmpsize, 1)) == NULL) { free(utmp); syslog(LOG_ERR, "%s", strerror(errno)); exit(1); -- 2.20.1