diff options
author | Dimitry Andric <dim@FreeBSD.org> | 2017-04-16 16:02:53 +0000 |
---|---|---|
committer | Dimitry Andric <dim@FreeBSD.org> | 2017-04-16 16:02:53 +0000 |
commit | ab0bf875a5f328a6710f4e48258979ae1bc8da1c (patch) | |
tree | 66903cf9f73151825893dcc216b04c0930317a10 /test/scudo/secondary.cpp | |
parent | abacad30a54c59ad437ccf54ec5236a8dd7f3ba9 (diff) |
Notes
Diffstat (limited to 'test/scudo/secondary.cpp')
-rw-r--r-- | test/scudo/secondary.cpp | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/test/scudo/secondary.cpp b/test/scudo/secondary.cpp index 7a634a81eb03e..dc14f8ca846ee 100644 --- a/test/scudo/secondary.cpp +++ b/test/scudo/secondary.cpp @@ -5,12 +5,12 @@ // Test that we hit a guard page when writing past the end of a chunk // allocated by the Secondary allocator, or writing too far in front of it. +#include <assert.h> #include <malloc.h> +#include <signal.h> #include <stdlib.h> #include <string.h> #include <unistd.h> -#include <signal.h> -#include <assert.h> void handler(int signo, siginfo_t *info, void *uctx) { if (info->si_code == SEGV_ACCERR) { @@ -33,8 +33,7 @@ int main(int argc, char **argv) a.sa_flags = SA_SIGINFO; char *p = (char *)malloc(size); - if (!p) - return 1; + assert(p); memset(p, 'A', size); // This should not trigger anything. // Set up the SIGSEGV handler now, as the rest should trigger an AV. sigaction(SIGSEGV, &a, nullptr); |