CVE-2026-40489: Stack Buffer Overflow Via Strcpy

A stack-based buffer overflow can occur when copying a string into a locally allocated, fixed-size array using `strcpy` without prior bounds-checking. Use `memcpy` with length validation instead.

Provally CuratedPublic repositoryHighMedium confidenceVerifiedApache-2.0C
greprules fetch cve-2026-40489-stack-buffer-overflow-via-strcpy --engine opengrep

Description

A stack-based buffer overflow can occur when copying a string into a locally allocated, fixed-size array using `strcpy` without prior bounds-checking. Use `memcpy` with length validation instead.