SecureCoding-5.9¶
Comparison of padding data
Required inputs: IR
Possible Messages
Key |
Text |
Severity |
Disabled |
|---|---|---|---|
disallowed_memcmp_pointer_arg |
Disallowed type of pointer argument. |
None |
False |
memcmp_char_pointer_arg |
memcmp shall not be used with char pointer argument, use strncmp instead. |
None |
False |
memcmp_float |
memcmp shall not be used to compare floats as the same value may be stored using different representations. |
None |
False |
memcmp_padding |
memcmp shall not be used to compare structs with padding. |
None |
False |
memcmp_struct_pointer_arg |
memcmp shall not be used with struct pointer argument as it would compare padding as well. |
None |
False |
memcmp_union_pointer_arg |
memcmp shall not be used with union pointer argument as it would compare padding and different kinds of representation. |
None |
False |
Options¶
This rule shares the following common options: exclude_in_macros, exclude_messages_in_system_headers, excludes, extend_exclude_to_macro_invocations, includes, justification_checker, languages, post_processing, provider, report_at, severity
The following places define options that affect this rule: Stylechecks, Analysis-GlobalOptions
allow_char¶
allow_char : bool = True
memcmp on char type.
allow_composites_without_padding¶
allow_composites_without_padding : bool = True
memcmp on structs and unions that have no
padding bytes.
allow_float¶
allow_float : bool = False
memcmp on floating point types.
functions¶
functions : set[bauhaus.analysis.config.QualifiedName] = {'memcmp'}
ignore_calls_in_functions¶
ignore_calls_in_functions : set[bauhaus.analysis.config.QualifiedName] = set()