summaryrefslogtreecommitdiffstats
path: root/crypto/stack
diff options
context:
space:
mode:
authorMatt Caswell <matt@openssl.org>2015-03-12 13:54:44 +0100
committerMatt Caswell <matt@openssl.org>2015-03-17 14:39:53 +0100
commit7132ac830fa08d9a936e011d7c541b0c52115b33 (patch)
tree3d484f646eecb397b417d2bdb0dc30f88d3221fa /crypto/stack
parentMove malloc fail checks closer to malloc (diff)
downloadopenssl-7132ac830fa08d9a936e011d7c541b0c52115b33.tar.xz
openssl-7132ac830fa08d9a936e011d7c541b0c52115b33.zip
Fix memset call in stack.c
The function sk_zero is supposed to zero the elements held within a stack. It uses memset to do this. However it calculates the size of each element as being sizeof(char **) instead of sizeof(char *). This probably doesn't make much practical difference in most cases, but isn't a portable assumption. Reviewed-by: Richard Levitte <levitte@openssl.org>
Diffstat (limited to 'crypto/stack')
-rw-r--r--crypto/stack/stack.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/crypto/stack/stack.c b/crypto/stack/stack.c
index 1b89f551f1..7d97c2cbb4 100644
--- a/crypto/stack/stack.c
+++ b/crypto/stack/stack.c
@@ -299,7 +299,7 @@ void sk_zero(_STACK *st)
return;
if (st->num <= 0)
return;
- memset((char *)st->data, 0, sizeof(st->data) * st->num);
+ memset((char *)st->data, 0, sizeof(*st->data) * st->num);
st->num = 0;
}