]> git.ipfire.org Git - thirdparty/openssh-portable.git/commitdiff
upstream commit
authorjsg@openbsd.org <jsg@openbsd.org>
Tue, 5 May 2015 02:48:17 +0000 (02:48 +0000)
committerDamien Miller <djm@mindrot.org>
Fri, 8 May 2015 03:32:55 +0000 (13:32 +1000)
use the sizeof the struct not the sizeof a pointer to the
 struct in ssh_digest_start()

This file is only used if ssh is built with OPENSSL=no

ok markus@

digest-libc.c

index a216e784e2ae67997d7bb4fa68e6f90fd6cd0f35..40db00274d745dbc0826aff0b724181ba40e53c1 100644 (file)
@@ -1,4 +1,4 @@
-/* $OpenBSD: digest-libc.c,v 1.4 2014/12/21 22:27:56 djm Exp $ */
+/* $OpenBSD: digest-libc.c,v 1.5 2015/05/05 02:48:17 jsg Exp $ */
 /*
  * Copyright (c) 2013 Damien Miller <djm@mindrot.org>
  * Copyright (c) 2014 Markus Friedl.  All rights reserved.
@@ -172,7 +172,7 @@ ssh_digest_start(int alg)
        const struct ssh_digest *digest = ssh_digest_by_alg(alg);
        struct ssh_digest_ctx *ret;
 
-       if (digest == NULL || (ret = calloc(1, sizeof(ret))) == NULL)
+       if (digest == NULL || (ret = calloc(1, sizeof(*ret))) == NULL)
                return NULL;
        if ((ret->mdctx = calloc(1, digest->ctx_len)) == NULL) {
                free(ret);