Add a test for sodium_allocarray(0, x)

This commit is contained in:
Frank Denis 2015-03-23 21:47:44 +01:00
parent dbcca2a501
commit f379ab8766

View File

@ -39,6 +39,10 @@ int main(void)
if (sodium_allocarray(SIZE_MAX / 2U + 1U, SIZE_MAX / 2U) != NULL) { if (sodium_allocarray(SIZE_MAX / 2U + 1U, SIZE_MAX / 2U) != NULL) {
return 1; return 1;
} }
sodium_free(sodium_allocarray(0U, 0U));
sodium_free(sodium_allocarray(0U, 1U));
sodium_free(sodium_allocarray(1U, 0U));
buf = sodium_allocarray(1000U, 50U); buf = sodium_allocarray(1000U, 50U);
memset(buf, 0, 50000U); memset(buf, 0, 50000U);
sodium_free(buf); sodium_free(buf);