summaryrefslogtreecommitdiff
path: root/src/string/memmove_s.c
diff options
context:
space:
mode:
authorJakob Kaivo <jkk@ung.org>2024-06-11 13:44:21 -0400
committerJakob Kaivo <jkk@ung.org>2024-06-11 13:44:21 -0400
commit4f29706128f3d3a66f0503d07c4960d4021aaf27 (patch)
tree7f76ae1b7819b99756feb1daf93cfe31d5c41c3b /src/string/memmove_s.c
parent523944d96e11bde68bf9bcf8e42b7ebc99c5ed3d (diff)
support watching for dangerous parameter accessnon-posix
Diffstat (limited to 'src/string/memmove_s.c')
-rw-r--r--src/string/memmove_s.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/string/memmove_s.c b/src/string/memmove_s.c
index 209a8957..d9a3588a 100644
--- a/src/string/memmove_s.c
+++ b/src/string/memmove_s.c
@@ -8,6 +8,8 @@ errno_t memmove_s(void *s1, rsize_t s1max, const void *s2, rsize_t n)
SIGNAL_SAFE(0);
ASSERT_NONNULL(s1);
ASSERT_NONNULL(s2);
+ DANGEROUS_READ(s2, n);
+ DANGEROUS_WRITE(s1, s1max);
/* Overlap is explicitly allowed */
if (n > s1max) {
@@ -15,6 +17,9 @@ errno_t memmove_s(void *s1, rsize_t s1max, const void *s2, rsize_t n)
}
memmove(s1, s2, n);
+
+ DANGER_OVER();
+
return 0;
}