diff options
-rw-r--r-- | backends/mqtt.c | 2 | ||||
-rw-r--r-- | backends/rtpmidi.c | 6 |
2 files changed, 5 insertions, 3 deletions
diff --git a/backends/mqtt.c b/backends/mqtt.c index 47042f1..da4bf38 100644 --- a/backends/mqtt.c +++ b/backends/mqtt.c @@ -765,7 +765,7 @@ static int mqtt_handle_publish(instance* inst, uint8_t type, uint8_t* variable_h uint16_t topic_alias = 0; uint32_t property_length = 0; size_t u = data->nchannels, property_offset, payload_offset, payload_length; - size_t topic_length = mqtt_pop_utf8(variable_header, length, &topic); + size_t topic_length = min(mqtt_pop_utf8(variable_header, length, &topic), length); property_offset = payload_offset = topic_length + 2 + ((qos > 0) ? 2 : 0); if(data->mqtt_version == 0x05){ diff --git a/backends/rtpmidi.c b/backends/rtpmidi.c index 922075e..d349e6f 100644 --- a/backends/rtpmidi.c +++ b/backends/rtpmidi.c @@ -1299,8 +1299,10 @@ static int rtpmidi_mdns_broadcast(uint8_t* frame, size_t len){ }; //send to ipv4 and ipv6 mcasts - sendto(cfg.mdns_fd, frame, len, 0, (struct sockaddr*) &mcast6, sizeof(mcast6)); - sendto(cfg.mdns4_fd, frame, len, 0, (struct sockaddr*) &mcast, sizeof(mcast)); + if((sendto(cfg.mdns_fd, frame, len, 0, (struct sockaddr*) &mcast6, sizeof(mcast6)) != len) + | (sendto(cfg.mdns4_fd, frame, len, 0, (struct sockaddr*) &mcast, sizeof(mcast)) != len)){ + LOG("Failed to transmit mDNS frame"); + } return 0; } |