The SAMATE Project Department of Homeland Security
Downloads:  Selected

Back to the previous page...Back to the previous page

Test Case IDCandidate14
Bad / GoodBadBad test case
AuthorN/A
Associated test caseN/A
ContributorSecureSoftware
LanguageC
Type of test caseSource Code
Input stringN/A
Expected OutputN/A
InstructionsN/A
Submission date2005-10-21
DescriptioniconA stack overflow condition is a buffer overflow condition, where the buffer being overwritten is allocated on the stack (i.e., is a local variable or, rarely, a parameter to a function). (from TCCLASP-5_2_3_10)
Filename
Flaw
  • (?) CWE-121: Stack-based Buffer Overflow at line 5

There is no comments :: Submit a comment :: RSS

>./Stack_overflow.c
  1. /* Stack Overflow */
  2. #define BUFSIZE 256
  3. int main(int argc, char **argv) {
  4. char buf[BUFSIZE];
  5. strcpy(buf, argv[1]);
  6. }
  7.  
  8.  
  9.