mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2026-04-30 06:46:49 -04:00
Memory Safety: High In get_midi_size(), the overflow check for SysEx and meta-event message sizes has the comparison operator inverted. The check (unsigned int)(INT_MAX - size - 1) > value rejects small (safe) payload sizes and accepts large sizes that cause signed integer overflow in the subsequent size += (int)value + 1. This means all SysEx messages (0xF0, 0xF7) and system reset/meta events (0xFF) with valid payloads are incorrectly rejected, while crafted packets with very large variable-length values bypass the check. Although the caller has a secondary bounds check that mitigates most exploitation, the inverted check is both a functional bug (breaks SysEx over RTP) and a defense-in-depth failure. Fix by swapping the operands so that the check correctly rejects values that would overflow: value > (unsigned int)(INT_MAX - size - 1). Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> |
||
|---|---|---|
| .. | ||
| apple-midi.h | ||
| audio.c | ||
| midi.c | ||
| opus.c | ||
| ptp.h | ||
| rtp.h | ||
| sap.h | ||
| stream.c | ||
| stream.h | ||