From 4de2bad817cc2a71145b04573cfb41198b976061 Mon Sep 17 00:00:00 2001 From: Arkadiusz Lichwa Date: Fri, 23 Dec 2016 00:50:38 +0100 Subject: [PATCH] Bluetooth: SDP: Check SDP error when receiving PDU response Stops handle data if server responds with SDP Error PDU Jira: ZEP-1112 Change-Id: Iaddb740f71fa86384753ab32956fc69b89faeea0 Signed-off-by: Arkadiusz Lichwa --- subsys/bluetooth/host/sdp.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/subsys/bluetooth/host/sdp.c b/subsys/bluetooth/host/sdp.c index 3619cf2f28f..657035dcdae 100644 --- a/subsys/bluetooth/host/sdp.c +++ b/subsys/bluetooth/host/sdp.c @@ -334,6 +334,11 @@ static void sdp_client_receive(struct bt_l2cap_chan *chan, struct net_buf *buf) return; } + if (hdr->op_code == BT_SDP_ERROR_RSP) { + BT_INFO("Error SDP PDU response"); + return; + } + len = sys_be16_to_cpu(hdr->param_len); tid = sys_be16_to_cpu(hdr->tid); net_buf_pull(buf, sizeof(*hdr));