summaryrefslogtreecommitdiff
path: root/src/string/strncpy.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/string/strncpy.c')
-rw-r--r--src/string/strncpy.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/string/strncpy.c b/src/string/strncpy.c
index 2b4c40d1..0dd18aab 100644
--- a/src/string/strncpy.c
+++ b/src/string/strncpy.c
@@ -11,6 +11,8 @@ char * strncpy(char * restrict s1, const char * restrict s2, size_t n)
ASSERT_NONNULL(s1);
ASSERT_NONNULL(s2);
ASSERT_NOOVERLAP(s1, n, s2, n);
+ DANGEROUS_READ(s2, n);
+ DANGEROUS_WRITE(s1, n);
for (i = 0; i < n; i++) {
s1[i] = s2[i];
@@ -20,6 +22,8 @@ char * strncpy(char * restrict s1, const char * restrict s2, size_t n)
}
}
+ DANGER_OVER();
+
return s1;
}