From: Damien Miller Date: Fri, 9 Dec 2022 07:00:21 +0000 (+1100) Subject: use calloc for allocating arc4random structs X-Git-Tag: V_9_2_P1~79 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ea6fdf9a1aa71a411f7db218a986392c4fb55693;p=thirdparty%2Fopenssh-portable.git use calloc for allocating arc4random structs ok dtucker --- diff --git a/openbsd-compat/arc4random.h b/openbsd-compat/arc4random.h index 01629752d..5af3a4492 100644 --- a/openbsd-compat/arc4random.h +++ b/openbsd-compat/arc4random.h @@ -75,9 +75,9 @@ _rs_allocate(struct _rs **rsp, struct _rsx **rsxp) return (-1); } #else - if ((*rsp = malloc(sizeof(**rsp))) == NULL) + if ((*rsp = calloc(1, sizeof(**rsp))) == NULL) return (-1); - if ((*rsxp = malloc(sizeof(**rsxp))) == NULL) { + if ((*rsxp = calloc(1, sizeof(**rsxp))) == NULL) { free(*rsp); *rsp = NULL; return (-1);