c-integer-promotion-and-conversion
Warn
Audited by Socket on Oct 3, 2026
2 alerts found:
Anomalyx2Anomalyexamples/good/integer_snippets.c
LOWAnomalyLOW
examples/good/integer_snippets.c
No evidence of malware or intentional obfuscation. `alloc_good` contains an integer-overflow flaw: its bound does not prevent overflow in `n * 4`, which can result in an undersized allocation. `strlen_sz` also relies on a valid null-terminated input string.
Confidence: 98%Severity: 55%
Anomalyexamples/bad/integer_snippets.c
LOWAnomalyLOW
examples/bad/integer_snippets.c
The code contains deliberate examples of integer conversion and allocation-size hazards. The allocation overflow could lead to an undersized buffer and memory corruption if callers rely on the intended size. No malicious behavior is evident in this fragment.
Confidence: 99%Severity: 55%
Audit Metadata