Taking error fix for IOTCLT-1439

pull/3789/head
Yogesh Pande 2017-02-23 08:23:39 +02:00
parent d3b48a8e2d
commit 9f8271e495
3 changed files with 10 additions and 13 deletions

View File

@ -1,6 +1,6 @@
# Change Log
## [v4.0.0](https://github.com/ARMmbed/mbed-coap/releases/tag/v4.0.0)
## [v4.0.0](https://github.com/ARMmbed/mbed-coap/releases/tag/v4.0.2)
**New feature**

View File

@ -1,15 +1,12 @@
{
"name": "mbed-coap",
"version": "4.0.0",
"version": "4.0.2",
"description": "COAP library",
"keywords": [
"coap",
"nanostack"
],
"license": "Apache-2.0",
"extraIncludes": [
"source/include"
],
"dependencies": {
"nanostack-libservice": "^3.0.0",
"mbed-trace": ">=0.2.0,<2.0.0",
@ -21,5 +18,9 @@
"url": "https://github.com/ARMmbed/mbed-coap.git",
"type": "git"
},
"homepage": "https://github.com/ARMmbed/mbed-coap"
"homepage": "https://github.com/ARMmbed/mbed-coap",
"extraIncludes": [
"mbed-coap",
"source/include"
]
}

View File

@ -655,7 +655,7 @@ static int16_t sn_coap_parser_options_count_needed_memory_multiple_option(uint8_
uint16_t i = 1;
/* 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) {
return -1;
}
@ -677,14 +677,10 @@ static int16_t sn_coap_parser_options_count_needed_memory_multiple_option(uint8_
i += option_number_len;
ret_value += option_number_len + 1; /* + 1 is for separator */
if(ret_value >= packet_left_len)
break;
if(ret_value >= packet_left_len)
break;
if( i == packet_left_len )
if( i >= packet_left_len ) {
break;
}
if ((*(packet_data_ptr + i) >> COAP_OPTIONS_OPTION_NUMBER_SHIFT) != 0) {
return (ret_value - 1); /* -1 because last Part path does not include separator */