summaryrefslogtreecommitdiff
path: root/src/string/strdup.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/string/strdup.c')
-rw-r--r--src/string/strdup.c3
1 files changed, 3 insertions, 0 deletions
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;