SAMATE Logo NIST Logo The SAMATE Project Department of Homeland Security
Downloads:  Download this Test Case #199266

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

Test Case IDCandidate199266
Bad / Good / MixedGoodGood test case
AuthorToyota ITC
Associations
Bad pair: 199265  
Test suite: 104  
Added byCharles Oliveira
LanguageC
Type of test caseSource Code
Input string
Expected Output
Instructionsgcc -Wall -I ../../../shared/104 func_pointer.c func_pointer_main.c -lm -lpthread
Submission date2016-07-22
DescriptionDefect Type: Pointer related defects
Defect Sub-type: Bad cast of a function pointer
Description: Defect Free Code to identify false positives in bad cast of function pointer

The test case contains coincidental weaknesses along with intended ones as follows for file func_pointer.c:
* line(s): 133,442 CWE-401
* line(s): 160,166,186,188,189,220,226,239,250,251,272,605,623 CWE-476
* line(s): 250 CWE-465
* line(s): 324,353 CWE-561
File(s)
Flaw

There are no comments
Have any comments on this test case? Please, .

File Contains:
CWE-476: NULL Pointer Dereference on line(s): 160, 166, 186, 188, 189, 220, 226, 239, 250, 251, 272, 319, 605, 623
CWE-704: Incorrect Type Conversion or Cast on line(s): 45, 64, 85, 131, 180, 265, 296, 362, 388, 438, 479, 511, 555, 617
CWE-401: Improper Release of Memory Before Removing Last Reference ('Memory Leak') on line(s): 133, 442
CWE-561: Dead Code on line(s): 324, 353
CWE-465: Pointer Issues on line(s): 250