summaryrefslogtreecommitdiff
path: root/lib/libcrypto/gost
diff options
context:
space:
mode:
authorBob Beck <beck@cvs.openbsd.org>2015-07-15 17:13:18 +0000
committerBob Beck <beck@cvs.openbsd.org>2015-07-15 17:13:18 +0000
commit16b94b1d0270646845952e4424b5166404bc148d (patch)
tree3a9e54c1a20a57caa2c6f63ffe5cdbfe18c7b071 /lib/libcrypto/gost
parent356b20e27b0e1a4d890bfe70810fe916436c6919 (diff)
Fix possible 32 byte buffer overrun, found by coverity, CID 78869
ok miod@
Diffstat (limited to 'lib/libcrypto/gost')
-rw-r--r--lib/libcrypto/gost/gostr341194.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/libcrypto/gost/gostr341194.c b/lib/libcrypto/gost/gostr341194.c
index 34ca504bb2e..32c166aefa0 100644
--- a/lib/libcrypto/gost/gostr341194.c
+++ b/lib/libcrypto/gost/gostr341194.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: gostr341194.c,v 1.3 2014/12/07 16:33:51 jsing Exp $ */
+/* $OpenBSD: gostr341194.c,v 1.4 2015/07/15 17:13:17 beck Exp $ */
/*
* Copyright (c) 2014 Dmitry Eremin-Solenikov <dbaryshkov@gmail.com>
* Copyright (c) 2005-2006 Cryptocom LTD
@@ -238,7 +238,7 @@ GOSTR341194_Final(unsigned char *md, GOSTR341194_CTX * c)
unsigned char T[32];
if (c->num > 0) {
- memset(p + c->num, 0, 32);
+ memset(p + c->num, 0, 32 - c->num);
hash_step(c, c->H, p);
add_blocks(32, c->S, p);
}