summaryrefslogtreecommitdiff
path: root/test/scudo/overflow.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'test/scudo/overflow.cpp')
-rw-r--r--test/scudo/overflow.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/test/scudo/overflow.cpp b/test/scudo/overflow.cpp
index c93a544ea0a07..d12824578524e 100644
--- a/test/scudo/overflow.cpp
+++ b/test/scudo/overflow.cpp
@@ -10,20 +10,20 @@
int main(int argc, char **argv)
{
- assert(argc == 2);
ssize_t offset = sizeof(void *) == 8 ? 8 : 0;
+
+ assert(argc == 2);
+
if (!strcmp(argv[1], "malloc")) {
// Simulate a header corruption of an allocated chunk (1-bit)
void *p = malloc(1U << 4);
- if (!p)
- return 1;
+ assert(p);
((char *)p)[-(offset + 1)] ^= 1;
free(p);
}
if (!strcmp(argv[1], "quarantine")) {
void *p = malloc(1U << 4);
- if (!p)
- return 1;
+ assert(p);
free(p);
// Simulate a header corruption of a quarantined chunk
((char *)p)[-(offset + 2)] ^= 1;