10 #define TEST_NAME "sodium_utils3"
16 printf("Intentional segfault / bus error caught\n");
19 signal(SIGSEGV
, SIG_DFL
);
22 signal(SIGBUS
, SIG_DFL
);
25 signal(SIGABRT
, SIG_DFL
);
37 signal(SIGSEGV
, segv_handler
);
40 signal(SIGBUS
, segv_handler
);
43 signal(SIGABRT
, segv_handler
);
45 size
= randombytes_uniform(100000U);
46 buf
= sodium_malloc(size
);
47 sodium_mprotect_noaccess(buf
);
48 sodium_mprotect_readwrite(buf
);
49 sodium_memzero(((unsigned char *) buf
) - 8, 8U);
50 sodium_mprotect_readonly(buf
);
52 printf("Underflow not caught\n");