mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2026-05-20 06:38:10 +02:00
Memory Safety: High In netjack2_recv_midi(), the offset calculation `max_size * sub_cycle` uses sub_cycle from an untrusted network packet header. A large sub_cycle value could cause integer overflow, producing a small offset that passes the subsequent bounds check and leads to an out-of-bounds write into the MIDI data buffer. Similarly, the bounds check `offset + len < midi_size` could itself overflow, and the `used` size calculation from network-controlled event_count and write_pos fields could overflow to bypass the size check. Fix by adding an explicit overflow check before the multiplication, rewriting the bounds check to use subtraction (which cannot overflow after the prior check), and adding an underflow check on the `used` calculation. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> |
||
|---|---|---|
| .. | ||
| packets.h | ||
| peer.c | ||