Anonymous
Not applicable
May 27, 2013
10:13 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
May 27, 2013
10:13 PM
[SDK-2.3.1]There seems to be a bug in wiced_packet_get_data, where data_length is assigned the length of the entire packets netbuf, rather than individual contiguous pbuf:
*data_length = packet->p->tot_len;...*data_length = (uint16_t)(*data_length - offset);E.g., if I have a netbuf of 2 pbufs of 5 bytes, and read at offset 0:
data_length = 10available_length = 10data = ... pbuf (5 bytes)So I will read past the end of data if I try to read more than 5 bytes.I think the initial value should be the length of the current pbuf:
*data_length = packet->p->len;...*data_length = (uint16_t)(*data_length - offset);So same read at 0 would be:
data_length = 5available_length = 10data = ... pbuf (5 bytes)
Labels
- Labels:
-
SPI
- Tags:
- affecting
- assert
- assumes
- buffers
- chained
- change
- code
- equal
- existing
- fact
- feedback
- functionality
- future
- internal
- issue
- lwip
- means
- p-len
- p-tot_len
- packet
- places
- prepared
- raised
- review
- support
- supporting
- tot_len
- version
- wiced
- wiced_packet_get_data
5 Replies