- Notifications
You must be signed in to change notification settings - Fork67
Open
Labels
Difficulty-MediumA false positive or false negative report which is expected to take 1-5 days effort to addressImpact-MediumStandard-AUTOSARStandard-MISRA-Cfalse positive/false negativeAn issue related to observed false positives or false negatives.false-negativeAn issue representing a false negative report.
Description
Affected rules
RULE-18-1
M5-0-16
Description
The query expects that as pointers are made they are assigned to variables, and assumes that pointers into arrays always useArrayExpr
(egx[y]
). It also allows dereferencing or indexing past 1 of an array -- its OK to make a pointer to 1 past the array, but dereferencing is not defined.
Example
voidexample_function() {int x[10];int *p1 = &x[12];// NON_COMPLIANTf(p1);int *p2 = x +12;// NON_COMPLIANT[FALSE_NEGATIVE]f(&x[12]);// NON_COMPLIANT[FALSE_NEGATIVE]int *p3 = &x[10];// COMPLIANT *p3;// NON_COMPLIANT[FALSE_NEGATIVE] x[10];// NON_COMPLIANT[FALSE_NEGATIVE] - at least for MISRA-C}
Metadata
Metadata
Assignees
Labels
Difficulty-MediumA false positive or false negative report which is expected to take 1-5 days effort to addressImpact-MediumStandard-AUTOSARStandard-MISRA-Cfalse positive/false negativeAn issue related to observed false positives or false negatives.false-negativeAn issue representing a false negative report.
Type
Projects
Status
Triaged