summaryrefslogtreecommitdiff
path: root/digest-openssl.c
diff options
context:
space:
mode:
authorColin Watson <cjwatson@debian.org>2017-03-29 01:35:00 +0100
committerColin Watson <cjwatson@debian.org>2017-03-29 01:35:00 +0100
commit6fabaf6fd9b07cc8bc6a17c9c4a5b76849cfc874 (patch)
treeb4377d09196e24e2c6f2c2128f66f92cf7891105 /digest-openssl.c
parent971a7653746a6972b907dfe0ce139c06e4a6f482 (diff)
parentd38f05dbdd291212bc95ea80648b72b7177e9f4e (diff)
Import openssh_7.5p1.orig.tar.gz
Diffstat (limited to 'digest-openssl.c')
-rw-r--r--digest-openssl.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/digest-openssl.c b/digest-openssl.c
index 13b63c2f0..c55ceb93f 100644
--- a/digest-openssl.c
+++ b/digest-openssl.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: digest-openssl.c,v 1.5 2014/12/21 22:27:56 djm Exp $ */ 1/* $OpenBSD: digest-openssl.c,v 1.6 2017/03/10 02:59:51 dtucker Exp $ */
2/* 2/*
3 * Copyright (c) 2013 Damien Miller <djm@mindrot.org> 3 * Copyright (c) 2013 Damien Miller <djm@mindrot.org>
4 * 4 *
@@ -158,7 +158,7 @@ ssh_digest_final(struct ssh_digest_ctx *ctx, u_char *d, size_t dlen)
158 const struct ssh_digest *digest = ssh_digest_by_alg(ctx->alg); 158 const struct ssh_digest *digest = ssh_digest_by_alg(ctx->alg);
159 u_int l = dlen; 159 u_int l = dlen;
160 160
161 if (dlen > UINT_MAX) 161 if (digest == NULL || dlen > UINT_MAX)
162 return SSH_ERR_INVALID_ARGUMENT; 162 return SSH_ERR_INVALID_ARGUMENT;
163 if (dlen < digest->digest_len) /* No truncation allowed */ 163 if (dlen < digest->digest_len) /* No truncation allowed */
164 return SSH_ERR_INVALID_ARGUMENT; 164 return SSH_ERR_INVALID_ARGUMENT;