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/strncmp.c | |
parent | 523944d96e11bde68bf9bcf8e42b7ebc99c5ed3d (diff) |
support watching for dangerous parameter accessnon-posix
Diffstat (limited to 'src/string/strncmp.c')
-rw-r--r-- | src/string/strncmp.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/string/strncmp.c b/src/string/strncmp.c index cf10e3f7..0cd6d872 100644 --- a/src/string/strncmp.c +++ b/src/string/strncmp.c @@ -10,12 +10,17 @@ int strncmp(const char *s1, const char *s2, size_t n) ASSERT_NONNULL(s2); /* no modifcation, overlap is OK */ + DANGEROUS_READ(s1, -1); if (strlen(s1) < n) { n = strlen(s1); } + DANGER_OVER(); + + DANGEROUS_READ(s2, -1); if (strlen(s2) < n) { n = strlen(s2); } + DANGER_OVER(); /* RETURN(NEGATIVE, ARGUMENT(s1) is less than ARGUMENT(s2)); |