]> git.ipfire.org Git - thirdparty/openssh-portable.git/commitdiff
use calloc for allocating arc4random structs
authorDamien Miller <djm@mindrot.org>
Fri, 9 Dec 2022 07:00:21 +0000 (18:00 +1100)
committerDamien Miller <djm@mindrot.org>
Fri, 9 Dec 2022 07:00:50 +0000 (18:00 +1100)
ok dtucker

openbsd-compat/arc4random.h

index 01629752d127e861da6e3b7f312138cc419b40f6..5af3a4492a826a1304b66c9e967a1d6611222e16 100644 (file)
@@ -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);