SecureCoding-5.36

Subtracting or comparing two pointers that do not refer to the same array

Required inputs: IR, StaticSemanticAnalysis

Rule description is currently unavailable for legal reasons.

Possible Messages

Key

Text

Severity

Disabled

possible_unrelated_ptr_comparison

Comparing possibly unrelated pointers

None

False

possible_unrelated_ptr_subtraction

Subtracting possibly unrelated pointers

None

False

unrelated_ptr_comparison

Comparing unrelated pointers

None

False

unrelated_ptr_subtraction

Subtracting unrelated pointers

None

False

Options

check_non_array_pointers

check_non_array_pointers : bool = False

Whether the check should also consider pointers to non-arrays (e.g., comparison of pointers to different fields). If enabled, a pointer to an object that is not an array is treated as if it were a pointer to the first element of an array with a single element.
 

report_empty_points_to_sets

report_empty_points_to_sets : bool = False

Report cases where one of the pointers involved in the comparison does not point to any value. This can occur e.g. if parameters of entry functions are analyzed, for which no values are known.