CWE-773¶
Missing Reference to Active File Descriptor or Handle. [Improper-Control-Of-A-Resource-Through-Its-Lifetime]
Required inputs: IR, StaticSemanticAnalysis
Possible Messages
Key |
Text |
Severity |
Disabled |
|---|---|---|---|
fd_multiple_deallocated |
Possible multiple ‘{}’ calls to file descriptor. |
None |
False |
fd_open_reference_lost |
Reference to active file descriptor created by ‘{}’ lost. |
None |
False |
memory_leak |
Call allocates leaking memory |
None |
False |
possible_memory_leak |
Call allocates possibly leaking memory |
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
allocators¶
allocators
Set of functions returning a new file descriptor.Type: set[bauhaus.analysis.config.QualifiedName]
Default:
{'_creat', '_dup', '_dup2', '_open', '_wcreat', '_wopen', 'creat', 'dup', 'dup2', 'dup3', 'open', 'openat', 'openat2'}
deallocators¶
deallocators : set[bauhaus.analysis.config.QualifiedName] = {'_close', 'close'}
resources¶
resources : set[str] = {'FileHandle'}
test_open_filedescriptor_double_closed¶
test_open_filedescriptor_double_closed : bool = False
test_open_filedescriptor_reference_lost¶
test_open_filedescriptor_reference_lost : bool = True
witness_paths¶
witness_paths : bool = True
witness_should_include_exception_handling¶
witness_should_include_exception_handling : bool = False