mirror of
https://github.com/owntone/owntone-server.git
synced 2025-07-08 16:42:21 -04:00
[cast] Length check of protobuf messages just to be safe
This commit is contained in:
parent
07f012bd69
commit
036100eecd
@ -725,7 +725,7 @@ cast_msg_send(struct cast_session *cs, enum cast_msg_types type, cast_reply_cb r
|
|||||||
msg.payload_utf8 = msg_buf;
|
msg.payload_utf8 = msg_buf;
|
||||||
|
|
||||||
len = extensions__core_api__cast_channel__cast_message__get_packed_size(&msg);
|
len = extensions__core_api__cast_channel__cast_message__get_packed_size(&msg);
|
||||||
if (len <= 0)
|
if (len <= 0 || len >= sizeof(buf) - 4)
|
||||||
{
|
{
|
||||||
DPRINTF(E_LOG, L_CAST, "Could not send message (type %d), invalid length: %zu\n", type, len);
|
DPRINTF(E_LOG, L_CAST, "Could not send message (type %d), invalid length: %zu\n", type, len);
|
||||||
return -1;
|
return -1;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user