summaryrefslogtreecommitdiff
path: root/tests/test_strncpy_overwrite_under.c
diff options
context:
space:
mode:
authorjvoisin2023-12-27 12:36:47 +0100
committerJulien Voisin2023-12-27 16:06:59 +0100
commit80a83a56b52e833e6d3afec4d0723d7625d52cee (patch)
treed8b0c2930b867f2eb1867f3f362b64dac84ce3ac /tests/test_strncpy_overwrite_under.c
parent01dc0e38a8a0be034bf21cc6ae4cc8cebc0e7a79 (diff)
Don't check for overlapping in strncpy/stpncpy for now
They check overlap across the whole range of the given length, but the given length is not what will actually be copied, rather it's the maximum length (if src is shorter, only length of src will be copied). This triggers false positives and traps where it shouldn't (e.g. in ICU tests). Reported-by: q66
Diffstat (limited to 'tests/test_strncpy_overwrite_under.c')
-rw-r--r--tests/test_strncpy_overwrite_under.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/tests/test_strncpy_overwrite_under.c b/tests/test_strncpy_overwrite_under.c
index f554b28..8a0a4af 100644
--- a/tests/test_strncpy_overwrite_under.c
+++ b/tests/test_strncpy_overwrite_under.c
@@ -3,6 +3,7 @@
3#include <string.h> 3#include <string.h>
4 4
5int main(int argc, char** argv) { 5int main(int argc, char** argv) {
6#if 0
6 char buffer[9] = {'A', 'A', 'A', 'A', 'B', 'B', 'B', 'B', '\0'}; 7 char buffer[9] = {'A', 'A', 'A', 'A', 'B', 'B', 'B', 'B', '\0'};
7 puts(buffer); 8 puts(buffer);
8 9
@@ -11,5 +12,6 @@ int main(int argc, char** argv) {
11 CHK_FAIL_END 12 CHK_FAIL_END
12 13
13 puts(buffer); 14 puts(buffer);
15#endif
14 return ret; 16 return ret;
15} 17}