aboutsummaryrefslogtreecommitdiffstats
path: root/crypto/bn/bn_lcl.h
diff options
context:
space:
mode:
authorRich Salz <rsalz@akamai.com>2015-05-04 18:00:15 -0400
committerRich Salz <rsalz@openssl.org>2015-05-05 22:18:59 -0400
commit16f8d4ebf0fd4847fa83d9c61f4150273cb4f533 (patch)
tree3c30094cad38433c24008c30efe3d93cf38d8ae9 /crypto/bn/bn_lcl.h
parent12048657a91b12e499d03ec9ff406b42aba67366 (diff)
downloadopenssl-16f8d4ebf0fd4847fa83d9c61f4150273cb4f533.tar.gz
memset, memcpy, sizeof consistency fixes
Just as with the OPENSSL_malloc calls, consistently use sizeof(*ptr) for memset and memcpy. Remove needless casts for those functions. For memset, replace alternative forms of zero with 0. Reviewed-by: Richard Levitte <levitte@openssl.org>
Diffstat (limited to 'crypto/bn/bn_lcl.h')
-rw-r--r--crypto/bn/bn_lcl.h6
1 files changed, 3 insertions, 3 deletions
diff --git a/crypto/bn/bn_lcl.h b/crypto/bn/bn_lcl.h
index a24ae7fdc9..196df7ea10 100644
--- a/crypto/bn/bn_lcl.h
+++ b/crypto/bn/bn_lcl.h
@@ -167,10 +167,10 @@ int RAND_pseudo_bytes(unsigned char *buf, int num);
* *genuinely* constant variables that aren't mutable \
* wouldn't be constructed with top!=dmax. */ \
BN_ULONG *_not_const; \
- memcpy(&_not_const, &_bnum1->d, sizeof(BN_ULONG*)); \
+ memcpy(&_not_const, &_bnum1->d, sizeof(_not_const)); \
RAND_bytes(&_tmp_char, 1); /* Debug only - safe to ignore error return */\
- memset((unsigned char *)(_not_const + _bnum1->top), _tmp_char, \
- (_bnum1->dmax - _bnum1->top) * sizeof(BN_ULONG)); \
+ memset(_not_const + _bnum1->top, _tmp_char, \
+ sizeof(*_not_const) * (_bnum1->dmax - _bnum1->top)); \
} \
} while(0)
# ifdef BN_DEBUG_TRIX