diff options
| author | jvoisin | 2023-12-27 12:36:47 +0100 |
|---|---|---|
| committer | Julien Voisin | 2023-12-27 16:06:59 +0100 |
| commit | 80a83a56b52e833e6d3afec4d0723d7625d52cee (patch) | |
| tree | d8b0c2930b867f2eb1867f3f362b64dac84ce3ac /tests/test_strncpy_overwrite_over.c | |
| parent | 01dc0e38a8a0be034bf21cc6ae4cc8cebc0e7a79 (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_over.c')
| -rw-r--r-- | tests/test_strncpy_overwrite_over.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/tests/test_strncpy_overwrite_over.c b/tests/test_strncpy_overwrite_over.c index d584bcc..94b6d2b 100644 --- a/tests/test_strncpy_overwrite_over.c +++ b/tests/test_strncpy_overwrite_over.c | |||
| @@ -3,6 +3,7 @@ | |||
| 3 | #include <string.h> | 3 | #include <string.h> |
| 4 | 4 | ||
| 5 | int main(int argc, char** argv) { | 5 | int 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 | } |
