1
mirror of https://github.com/jedisct1/libsodium.git synced 2024-12-23 20:15:19 -07:00

Don't expect signals to work in Javascript

This commit is contained in:
Frank Denis 2014-11-24 17:48:51 -08:00
parent 69e3674c29
commit 5437f8974d
2 changed files with 4 additions and 2 deletions

View File

@ -67,10 +67,11 @@ int main(void)
buf = sodium_malloc(size);
sodium_mprotect_readonly(buf);
sodium_mprotect_readwrite(buf);
#ifndef __EMSCRIPTEN__
sodium_memzero(((unsigned char *)buf) + size, 1U);
sodium_mprotect_noaccess(buf);
sodium_free(buf);
printf("Overflow not caught\n");
#endif
return 0;
}

View File

@ -45,10 +45,11 @@ int main(void)
buf = sodium_malloc(size);
sodium_mprotect_noaccess(buf);
sodium_mprotect_readwrite(buf);
#ifndef __EMSCRIPTEN__
sodium_memzero(((unsigned char *)buf) - 8, 8U);
sodium_mprotect_readonly(buf);
sodium_free(buf);
printf("Underflow not caught\n");
#endif
return 0;
}