sendspin: avoid buffer overread

Check that we have enough bytes (>=9) to parse the message type and the
timestamp.
This commit is contained in:
Wim Taymans 2026-05-08 10:33:39 +02:00
parent 22243d5ce9
commit 6cee86e509

View file

@ -876,9 +876,14 @@ static int do_handle_binary(struct client *client, const uint8_t *payload, int s
{
struct impl *impl = client->impl;
int32_t filled;
uint32_t index, length = size - 9;
uint32_t index, length;
uint64_t timestamp;
if (size < 9)
return 0;
length = size - 9;
if (payload[0] != 4 || client->stream == NULL)
return 0;