#include "common.h" #include int main(int argc, char** argv) { char buffer[8] = {0}; strncat(buffer, "12345", 5); puts(buffer); /* n=4 is less than buffer size (8), but buffer already has 5 chars, * so appending 4 more + NUL = 10 bytes total, overflowing the buffer. */ CHK_FAIL_START strncat(buffer, "ABCD", 4); CHK_FAIL_END puts(buffer); return ret; }