CVE-2026-26309: Sprintf Null Byte Overwrite Oob

Writing to a string or array index immediately after `sprintf` without a bounds check can cause an out-of-bounds write. `sprintf` automatically writes a trailing null byte. Manually overwriting it after incrementing the position can corrupt the null-termination of dynamic strings (like `std::string`) if the new position aligns exactly with the end of the all

Provally CuratedPublic repositoryMediumMedium confidenceVerifiedApache-2.0C++
greprules fetch cve-2026-26309-sprintf-null-byte-overwrite-oob --engine opengrep

Description

Writing to a string or array index immediately after `sprintf` without a bounds check can cause an out-of-bounds write. `sprintf` automatically writes a trailing null byte. Manually overwriting it after incrementing the position can corrupt the null-termination of dynamic strings (like `std::string`) if the new position aligns exactly with the end of the all