aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBodo Möller <bodo@openssl.org>2002-11-20 10:55:27 +0000
committerBodo Möller <bodo@openssl.org>2002-11-20 10:55:27 +0000
commit8a09b3866a9621210b80106b7512da710b0e17ce (patch)
tree2121b47889669068b1e01721ba92d48ee2312e1d
parent137445140ba28906e0424a9252f3fda8c570eda4 (diff)
downloadopenssl-8a09b3866a9621210b80106b7512da710b0e17ce.tar.gz
avoid uninitialized memory read
Submitted by: Nils Larsch
-rw-r--r--crypto/md32_common.h7
1 files changed, 5 insertions, 2 deletions
diff --git a/crypto/md32_common.h b/crypto/md32_common.h
index 353d2b96ad..86e41bf6df 100644
--- a/crypto/md32_common.h
+++ b/crypto/md32_common.h
@@ -1,6 +1,6 @@
/* crypto/md32_common.h */
/* ====================================================================
- * Copyright (c) 1999 The OpenSSL Project. All rights reserved.
+ * Copyright (c) 1999-2002 The OpenSSL Project. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -456,7 +456,10 @@ int HASH_UPDATE (HASH_CTX *c, const void *data_, unsigned long len)
{
ew=(c->num>>2);
ec=(c->num&0x03);
- l=p[sw]; HOST_p_c2l(data,l,sc); p[sw++]=l;
+ if (sc)
+ l=p[sw];
+ HOST_p_c2l(data,l,sc);
+ p[sw++]=l;
for (; sw < ew; sw++)
{
HOST_c2l(data,l); p[sw]=l;