From c4596b6ceb562f5bd0ac985e4764517f36e25642 Mon Sep 17 00:00:00 2001 From: Luiz Augusto von Dentz Date: Fri, 19 Dec 2008 19:41:39 -0300 Subject: Be more strict about message size mismatches. --- audio/unix.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/audio/unix.c b/audio/unix.c index bf0dad47..dcfe932d 100644 --- a/audio/unix.c +++ b/audio/unix.c @@ -1128,6 +1128,11 @@ static gboolean client_cb(GIOChannel *chan, GIOCondition cond, gpointer data) debug("Audio API: %s <- %s", type, name); + if (msghdr->length != len) { + error("Invalid message: length mismatch"); + goto failed; + } + switch (msghdr->name) { case BT_GET_CAPABILITIES: handle_getcapabilities_req(client, -- cgit