mirror of https://github.com/ARMmbed/mbed-os.git
Reverting fix for IOTCLT-1439 because of regression
parent
9f8271e495
commit
f51329b858
|
@ -655,7 +655,7 @@ static int16_t sn_coap_parser_options_count_needed_memory_multiple_option(uint8_
|
||||||
uint16_t i = 1;
|
uint16_t i = 1;
|
||||||
|
|
||||||
/* Loop all Uri-Query options */
|
/* Loop all Uri-Query options */
|
||||||
while (i <= packet_left_len) {
|
while (i < packet_left_len) {
|
||||||
if (option == COAP_OPTION_LOCATION_PATH && option_number_len > 255) {
|
if (option == COAP_OPTION_LOCATION_PATH && option_number_len > 255) {
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
@ -677,10 +677,14 @@ static int16_t sn_coap_parser_options_count_needed_memory_multiple_option(uint8_
|
||||||
|
|
||||||
i += option_number_len;
|
i += option_number_len;
|
||||||
ret_value += option_number_len + 1; /* + 1 is for separator */
|
ret_value += option_number_len + 1; /* + 1 is for separator */
|
||||||
|
if(ret_value >= packet_left_len)
|
||||||
if( i >= packet_left_len ) {
|
break;
|
||||||
|
|
||||||
|
if(ret_value >= packet_left_len)
|
||||||
|
break;
|
||||||
|
|
||||||
|
if( i == packet_left_len )
|
||||||
break;
|
break;
|
||||||
}
|
|
||||||
|
|
||||||
if ((*(packet_data_ptr + i) >> COAP_OPTIONS_OPTION_NUMBER_SHIFT) != 0) {
|
if ((*(packet_data_ptr + i) >> COAP_OPTIONS_OPTION_NUMBER_SHIFT) != 0) {
|
||||||
return (ret_value - 1); /* -1 because last Part path does not include separator */
|
return (ret_value - 1); /* -1 because last Part path does not include separator */
|
||||||
|
|
Loading…
Reference in New Issue