National Institute of Standards and Technology
Package illustrating a test case

Test case 1490

Description

Common off-by-one defect. The strcpy() copies 11 characters in the source buffer including the terminating null character. Due to the index value, the assignment on line 31 cause an out-of-bound.
From "Secure Coding in C and C++" by Robert C. Seacord.
Page 30, Figure 2-6

Flaws

Have any comments on this test case? Please, send us an email.