diff options
Diffstat (limited to 'usr.sbin/bluetooth')
-rw-r--r-- | usr.sbin/bluetooth/sdpd/server.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/usr.sbin/bluetooth/sdpd/server.c b/usr.sbin/bluetooth/sdpd/server.c index bef7e3e..816c6f5 100644 --- a/usr.sbin/bluetooth/sdpd/server.c +++ b/usr.sbin/bluetooth/sdpd/server.c @@ -432,7 +432,8 @@ server_process_request(server_p srv, int32_t fd) return (-1); } - if (sizeof(*pdu) + (pdu->len = ntohs(pdu->len)) == len) { + if (len >= sizeof(*pdu) && + sizeof(*pdu) + (pdu->len = ntohs(pdu->len)) == len) { switch (pdu->pid) { case SDP_PDU_SERVICE_SEARCH_REQUEST: error = server_prepare_service_search_response(srv, fd); |