summaryrefslogtreecommitdiff
path: root/src/string/strncpy_s.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/string/strncpy_s.c')
-rw-r--r--src/string/strncpy_s.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/string/strncpy_s.c b/src/string/strncpy_s.c
index 81ff253b..fb7fd056 100644
--- a/src/string/strncpy_s.c
+++ b/src/string/strncpy_s.c
@@ -8,6 +8,8 @@ errno_t strncpy_s(char * restrict s1, rsize_t s1max, const char * restrict s2, r
ASSERT_NONNULL(s1);
ASSERT_NONNULL(s2);
ASSERT_NOOVERLAP(s1, s1max, s2, n);
+ DANGEROUS_READ(s2, n);
+ DANGEROUS_WRITE(s1, s1max);
size_t i;
for (i = 0; i < n; i++) {
@@ -21,6 +23,8 @@ errno_t strncpy_s(char * restrict s1, rsize_t s1max, const char * restrict s2, r
s1[i++] = '\0';
}
+ DANGER_OVER();
+
return 0;
}