CVE-2024-34403: Integer Overflow Allocation After Increment

A length variable is incremented and then multiplied by `sizeof` in an allocation call without safe bounds checking. This risks an integer overflow (both from the increment and the multiplication), potentially causing an undersized allocation and heap buffer overflow. Ensure strict checks against `INT_MAX`/`SIZE_MAX` or, ideally, use `calloc` directly.

Provally CuratedPublic repositoryHighMedium confidenceVerifiedApache-2.0Cβ
greprules fetch cve-2024-34403-integer-overflow-allocation-after-increment --engine opengrep

Description

A length variable is incremented and then multiplied by `sizeof` in an allocation call without safe bounds checking. This risks an integer overflow (both from the increment and the multiplication), potentially causing an undersized allocation and heap buffer overflow. Ensure strict checks against `INT_MAX`/`SIZE_MAX` or, ideally, use `calloc` directly.