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

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

Test Case IDCandidate199265
Bad / Good / MixedBadBad test case
AuthorToyota ITC
Associations
Good pair: 199266  
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

The test case contains coincidental weaknesses along with intended ones as follows for file func_pointer.c:
* line(s): 101,103,151,157,177,179,180,182,210,216,229,240,241,262,338,352,395,397,438,443,560,561,601 CWE-476
* line(s): 172,419 CWE-401
* line(s): 179 CWE-465
* line(s): 257,265 CWE-704
* line(s): 314 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): 101, 103, 151, 157, 177, 179, 180, 182, 210, 216, 229, 240, 241, 262, 338, 352, 395, 397, 438, 443, 560, 561, 601
CWE-704: Incorrect Type Conversion or Cast on line(s): 41, 60, 80, 122, 171, 255, 257, 265, 284, 307, 351, 373, 417, 453, 484, 528, 591
CWE-401: Improper Release of Memory Before Removing Last Reference ('Memory Leak') on line(s): 172, 419
CWE-561: Dead Code on line(s): 314
CWE-465: Pointer Issues on line(s): 179