CVE-2026-45699: Buffer Remaining Size Strlen Underflow

Remaining buffer capacity is calculated using `strlen(...)` instead of `sizeof(...)` or the buffer capacity. When the string length in the buffer equals the subtracted length, this subtraction underflows unsigned integers, bypassing subsequent bounds checks and causing buffer overflows.

Provally CuratedPublic repositoryHighHigh confidenceVerifiedApache-2.0C
greprules fetch cve-2026-45699-buffer-remaining-size-strlen-underflow --engine opengrep

Description

Remaining buffer capacity is calculated using `strlen(...)` instead of `sizeof(...)` or the buffer capacity. When the string length in the buffer equals the subtracted length, this subtraction underflows unsigned integers, bypassing subsequent bounds checks and causing buffer overflows.