Even more clever... and would crash if something weird happened, which is desirable.

This commit is contained in:
Adam Ierymenko 2020-07-02 13:58:31 -07:00
parent befc50ac3a
commit 404b7a5493
No known key found for this signature in database
GPG key ID: C8877CF2D7A5D7F3

View file

@ -106,7 +106,7 @@ void burn(volatile void *ptr, unsigned int len)
// zeroing operation above, as burn() is used to erase secrets and other // zeroing operation above, as burn() is used to erase secrets and other
// sensitive data. // sensitive data.
if ((reinterpret_cast<volatile uint8_t *>(ptr)[0] | reinterpret_cast<volatile uint8_t *>(ptr)[len-1]) != 0) if ((reinterpret_cast<volatile uint8_t *>(ptr)[0] | reinterpret_cast<volatile uint8_t *>(ptr)[len-1]) != 0)
throw BadAllocException; burn(ptr, len);
} }
static unsigned long _Utils_itoa(unsigned long n, char *s) static unsigned long _Utils_itoa(unsigned long n, char *s)