mirror of
https://gitlab.freedesktop.org/pulseaudio/pulseaudio.git
synced 2025-12-22 08:56:52 -05:00
blueooth: actually honour 'room' variable (llvm-clang-analyzer)
This commit is contained in:
parent
382eced35d
commit
1380f18e52
1 changed files with 6 additions and 3 deletions
|
|
@ -221,9 +221,7 @@ static int service_recv(struct userdata *u, bt_audio_msg_header_t *msg, size_t r
|
||||||
pa_assert(u);
|
pa_assert(u);
|
||||||
pa_assert(u->service_fd >= 0);
|
pa_assert(u->service_fd >= 0);
|
||||||
pa_assert(msg);
|
pa_assert(msg);
|
||||||
|
pa_assert(room >= sizeof(*msg));
|
||||||
if (room <= 0)
|
|
||||||
room = BT_SUGGESTED_BUFFER_SIZE;
|
|
||||||
|
|
||||||
pa_log_debug("Trying to receive message from audio service...");
|
pa_log_debug("Trying to receive message from audio service...");
|
||||||
|
|
||||||
|
|
@ -236,6 +234,11 @@ static int service_recv(struct userdata *u, bt_audio_msg_header_t *msg, size_t r
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (msg->length > room) {
|
||||||
|
pa_log_error("Not enough room.");
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
/* Secondly, read the payload */
|
/* Secondly, read the payload */
|
||||||
if (msg->length > sizeof(*msg)) {
|
if (msg->length > sizeof(*msg)) {
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue