CVE-2024-7264: Pointer Post Increment Length Underflow

Initializing an end pointer using post-increment from a start pointer ($PTR_END = $PTR_START++) causes $PTR_END to evaluate to the current position while $PTR_START advances. If $PTR_END fails to advance further (e.g., due to an immediate loop condition failure), subtracting $PTR_START from $PTR_END to calculate a length will yield a negative number. When as

Provally CuratedPublic repositoryHighMedium confidenceVerifiedApache-2.0Cβ
greprules fetch cve-2024-7264-pointer-post-increment-length-underflow --engine opengrep

Description

Initializing an end pointer using post-increment from a start pointer ($PTR_END = $PTR_START++) causes $PTR_END to evaluate to the current position while $PTR_START advances. If $PTR_END fails to advance further (e.g., due to an immediate loop condition failure), subtracting $PTR_START from $PTR_END to calculate a length will yield a negative number. When as