mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2026-05-27 21:37:37 -04:00
module: check packet size for CK messages
Check that the CK packet is large enough before we start reading its contents.
This commit is contained in:
parent
f3fc645496
commit
398f74571b
1 changed files with 6 additions and 4 deletions
|
|
@ -727,9 +727,6 @@ static void parse_apple_midi_cmd_in(struct impl *impl, bool ctrl, uint8_t *buffe
|
||||||
char addr[128];
|
char addr[128];
|
||||||
uint16_t port = 0;
|
uint16_t port = 0;
|
||||||
|
|
||||||
if ((size_t)len < sizeof(*hdr))
|
|
||||||
return;
|
|
||||||
|
|
||||||
initiator = ntohl(hdr->initiator);
|
initiator = ntohl(hdr->initiator);
|
||||||
ssrc = ntohl(hdr->ssrc);
|
ssrc = ntohl(hdr->ssrc);
|
||||||
|
|
||||||
|
|
@ -868,9 +865,14 @@ static void parse_apple_midi_cmd_ck(struct impl *impl, bool ctrl, uint8_t *buffe
|
||||||
struct rtp_apple_midi_ck reply;
|
struct rtp_apple_midi_ck reply;
|
||||||
struct session *sess;
|
struct session *sess;
|
||||||
uint64_t ts, t1, t2, t3;
|
uint64_t ts, t1, t2, t3;
|
||||||
uint32_t ssrc = ntohl(hdr->ssrc);
|
uint32_t ssrc;
|
||||||
struct timespec now;
|
struct timespec now;
|
||||||
|
|
||||||
|
if ((size_t)len < sizeof(*hdr))
|
||||||
|
return;
|
||||||
|
|
||||||
|
ssrc = ntohl(hdr->ssrc);
|
||||||
|
|
||||||
sess = find_session_by_ssrc(impl, ssrc);
|
sess = find_session_by_ssrc(impl, ssrc);
|
||||||
if (sess == NULL) {
|
if (sess == NULL) {
|
||||||
pw_log_warn("unknown SSRC %u", ssrc);
|
pw_log_warn("unknown SSRC %u", ssrc);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue