mirror of
https://gitlab.torproject.org/tpo/core/tor.git
synced 2024-11-27 22:03:31 +01:00
Refine the memwipe() arguments check for 18089 a little more.
We still silently ignore memwipe(NULL, ch, 0); and memwipe(ptr, ch, 0); /* for ptr != NULL */ But we now assert on: memwipe(NULL, ch, 30);
This commit is contained in:
parent
db81565331
commit
e2efa9e321
@ -3030,9 +3030,11 @@ base32_decode(char *dest, size_t destlen, const char *src, size_t srclen)
|
||||
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);
|
||||
|
Loading…
Reference in New Issue
Block a user