summaryrefslogtreecommitdiff
path: root/tests/test_strncat_n_gt_buf.c (follow)
AgeCommit message (Collapse)Author
32 hoursFix strncat/wcsncatjvoisin
Previously, no checks were done when __n <= __b, but strncat _appends_ after existing content, making this a overly broad check check. For example, with an 8-byte buffer containing "12345\0", strncat(buf, "ABCD", 4) would have the check skipped, but the result "12345ABCD\0" is 10 bytes, resulting in an overflow. This commit fixes this oversight, and adds a bunch of tests.