Export to GitHub

btstack - issue #408

SDP_QUERY_ATTRIBUTE_VALUE events generated by the daemon have invalid fields


Posted on Jul 29, 2014 by Swift Dog

In the daemon's handle_sdp_client_query_result, when handling SDP_QUERY_ATTRIBUTE_VALUE, the 16-bit event fields are improperly stored: event[0] = SDP_QUERY_ATTRIBUTE_VALUE; event[1] = ve->record_id; event[3] = ve->attribute_id; event[5] = ve->attribute_length;

The offsets are OK, but the assignment trims the values into 1 byte, instead of storing them in the offset in the buffer. I believe it should be something like: event[0] = SDP_QUERY_ATTRIBUTE_VALUE; bt_store_16(event, 1, (uint16_t)ve->record_id); bt_store_16(event, 3, ve->attribute_id); bt_store_16(event, 5, (uint16_t)ve->attribute_length);

What version of the product are you using? On what operating system? Present in the latest r2695.

Comment #1

Posted on Jul 29, 2014 by Swift Ox

Hi Koby

Thanks. You're right, of course. Fixed in r2697.

Matthias

Status: Fixed

Labels:
Type-Defect Priority-Medium