From 4f29706128f3d3a66f0503d07c4960d4021aaf27 Mon Sep 17 00:00:00 2001 From: Jakob Kaivo Date: Tue, 11 Jun 2024 13:44:21 -0400 Subject: support watching for dangerous parameter access --- src/string/strncat_s.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src/string/strncat_s.c') diff --git a/src/string/strncat_s.c b/src/string/strncat_s.c index 8cc1875e..27761b6f 100644 --- a/src/string/strncat_s.c +++ b/src/string/strncat_s.c @@ -8,6 +8,8 @@ errno_t strncat_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); char *append = s1 + strlen(s1); for (size_t i = 0; i < n; i++) { @@ -22,6 +24,8 @@ errno_t strncat_s(char * restrict s1, rsize_t s1max, const char * restrict s2, r *append = '\0'; } + DANGER_OVER(); + return 0; } -- cgit v1.2.1