frr
frr copied to clipboard
lib: Fix snprintf buffer overflow in PTM CSV encoding
Issue: snprintf returns desired length, not bytes written. When truncated, using return value causes position miscalculation and buffer overflow.
Before: pos += snprintf(...) /* Wrong when truncated / After: pos += MIN(ret, space - 1) / Actual bytes written */
For exmaple PTM CSV corruption: sendE0vent instead of sendEvent
Ticket:#4523916