c-integer-promotion-and-conversion

Warn

Audited by Socket on Oct 3, 2026

2 alerts found:

Anomalyx2
AnomalyLOW
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%
AnomalyLOW
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
Analyzed At
Oct 3, 2026, 10:22 PM
Package URL
pkg:socket/skills-sh/trothbyte%2Flow-level-skills-trothbyte%2Fc-integer-promotion-and-conversion%2F@08e5cef990c93219b6601b0ecaea86821ca1cc86e0f086ebd27aa423ca43496e