szn

Bug 329 — Missing OSC discard transition on buffer overflow causes input injection

329. Missing OSC discard transition on buffer overflow causes input injection

File: src/input.zig:337-353 Severity: MEDIUM Status: ✅ FIXED

When osc_buf.items.len reached the 1 MiB limit, advanceOsc cleared the buffer and transitioned to .ground, allowing remaining bytes of the long OSC string to be interpreted as ground input.

Root Cause

Missing .osc_discard state to absorb trailing OSC payload bytes.

Fix

Added .osc_discard and .osc_discard_esc states to consume trailing OSC bytes until ST or BEL.

Impact

Un-discarded trailing bytes of large OSC control strings leak into the grid as literal text or control commands.