summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/common/crypto.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/common/crypto.c b/src/common/crypto.c
index de4f9db94f..a42c461b14 100644
--- a/src/common/crypto.c
+++ b/src/common/crypto.c
@@ -2957,9 +2957,11 @@ smartlist_shuffle(smartlist_t *sl)
void
memwipe(void *mem, uint8_t byte, size_t sz)
{
- if (mem == NULL || sz == 0) {
+ if (sz == 0) {
return;
}
+ /* If sz is nonzero, then mem must not be NULL. */
+ tor_assert(mem != NULL);
/* Data this large is likely to be an underflow. */
tor_assert(sz < SIZE_T_CEILING);