Re: [PATCH BlueZ] monitor: Improbe decoding of ATT Read by Group Type Respose

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Luiz,

On Sun, May 24, 2015, Luiz Augusto von Dentz wrote:
> +static void print_group_list(const char *label, uint8_t length,
> +					const void *data, uint16_t size)
> +{
> +	uint8_t count;
> +
> +	if (length == 0)
> +		return;
> +
> +	count = size / length;
> +
> +	print_field("%s: %u entr%s", label, count, count == 1 ? "y" : "ies");
> +
> +	while (size >= length) {
> +		print_handle_range("Handle range", data);
> +		print_uuid("UUID", data + 4, length - 4);
> +
> +		data += length;
> +		size -= length;
> +	}
> +
> +	packet_hexdump(data, size);
> +}

Looks good, but to avoid btmon crashes (e.g. when analyzing codenomicon
logs) might be good to add check for 'length >= 6' and jump to
packet_hexdump if you get something smaller than that.

Johan
--
To unsubscribe from this list: send the line "unsubscribe linux-bluetooth" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Bluez Devel]     [Linux Wireless Networking]     [Linux Wireless Personal Area Networking]     [Linux ATH6KL]     [Linux USB Devel]     [Linux Media Drivers]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Big List of Linux Books]

  Powered by Linux