diff options
author | Jakob Kaivo <jkk@ung.org> | 2024-06-11 13:44:21 -0400 |
---|---|---|
committer | Jakob Kaivo <jkk@ung.org> | 2024-06-11 13:44:21 -0400 |
commit | 4f29706128f3d3a66f0503d07c4960d4021aaf27 (patch) | |
tree | 7f76ae1b7819b99756feb1daf93cfe31d5c41c3b /src/string/memmove_s.c | |
parent | 523944d96e11bde68bf9bcf8e42b7ebc99c5ed3d (diff) |
support watching for dangerous parameter accessnon-posix
Diffstat (limited to 'src/string/memmove_s.c')
-rw-r--r-- | src/string/memmove_s.c | 5 |
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; } |