summaryrefslogtreecommitdiff
path: root/tests/test_strncpy_static_write.c (unfollow)
AgeCommit message (Collapse)Author
2024-10-10Fix a crash in strncpy/stpncpystrnjvoisin
``` Core was generated by `scripts/mod/modpost -M -m -o Module.symvers -n -T modules.order vmlinux.o'. Program terminated with signal SIGSEGV, Segmentation fault. warning: 17 src/string/strlen.c: No such file or directory (gdb) bt ``` > I think strncpy logic is broken: `__fh_size_t max_len_s = strlen(__s);` may try read past `size_t __n`. > Create a buf without any trailing `\0`, do `strncpy(dest, buf, sizeof(buf));`, it should work, since `strncpy` will stop at `sizeof buf` > but the current fority-headers implementation will do `strlen(buf)`, which will go boom when it is not terminated with \0 Reported-by: ncopa
2023-06-14Add tests for strncpy and handle overlapping buffers therejvoisin
2023-04-13Add tests for strcat and strcpyjvoisin
2023-04-13Add tests for memsetjvoisin
2023-04-13Add a basic testsuitejvoisin