summaryrefslogtreecommitdiff
path: root/src/string/strcoll.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/strcoll.c
parent523944d96e11bde68bf9bcf8e42b7ebc99c5ed3d (diff)
support watching for dangerous parameter accessnon-posix
Diffstat (limited to 'src/string/strcoll.c')
-rw-r--r--src/string/strcoll.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/string/strcoll.c b/src/string/strcoll.c
index 7091e30f..8ea365b6 100644
--- a/src/string/strcoll.c
+++ b/src/string/strcoll.c
@@ -13,10 +13,16 @@ int strcoll(const char *s1, const char *s2)
SIGNAL_SAFE(0);
ASSERT_NONNULL(s1);
ASSERT_NONNULL(s2);
+
/* no modification, overlap is OK */
+ DANGEROUS_READ(s1, -1);
x1 = malloc(strxfrm(x1, s1, 0));
+ DANGER_OVER();
+
+ DANGEROUS_READ(s2, -1);
x2 = malloc(strxfrm(x2, s2, 0));
+ DANGER_OVER();
if (x1 && x2) {
strxfrm(x1, s1, 0);