From 4f29706128f3d3a66f0503d07c4960d4021aaf27 Mon Sep 17 00:00:00 2001 From: Jakob Kaivo Date: Tue, 11 Jun 2024 13:44:21 -0400 Subject: support watching for dangerous parameter access --- src/string/strdup.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src/string/strdup.c') diff --git a/src/string/strdup.c b/src/string/strdup.c index 9780deaa..0016a267 100644 --- a/src/string/strdup.c +++ b/src/string/strdup.c @@ -5,7 +5,10 @@ char *strdup(const char *s) { ASSERT_NONNULL(s); + DANGEROUS_READ(s, -1); size_t len = strlen(s) + 1; + DANGER_OVER(); + char *dup = malloc(len); memcpy(dup, s, len); return dup; -- cgit v1.2.1