The SAMATE Project Department of Homeland Security
Downloads:  Selected

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

Test Case IDCandidate15
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 heap overflow condition is a buffer overflow, where the buffer that can be overwritten is allocated in the heap portion of memory, generally meaning that the buffer was allocated using a routine such as the POSIX malloc() call. (from TCCLASP-5_2_4_10)
Filename
Flaw
  • (?) CWE-122: Heap-based Buffer Overflow at line 5

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

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