Saanch / btstack

Automatically exported from code.google.com/p/btstack
0 stars 0 forks source link

SDP_QUERY_ATTRIBUTE_VALUE events generated by the daemon have invalid fields #408

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
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.

Original issue reported on code.google.com by kob...@mce-sys.com on 29 Jul 2014 at 9:39

GoogleCodeExporter commented 9 years ago
Hi Koby

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

Matthias

Original comment by matthias.ringwald@gmail.com on 29 Jul 2014 at 3:08