Skip to content

Commit 9f8271e

Browse files
Yogesh PandeYogesh Pande
authored andcommitted
Taking error fix for IOTCLT-1439
1 parent d3b48a8 commit 9f8271e

File tree

3 files changed

+10
-13
lines changed

3 files changed

+10
-13
lines changed

features/FEATURE_COMMON_PAL/mbed-coap/CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Change Log
22

3-
## [v4.0.0](https://github.com/ARMmbed/mbed-coap/releases/tag/v4.0.0)
3+
## [v4.0.0](https://github.com/ARMmbed/mbed-coap/releases/tag/v4.0.2)
44

55
**New feature**
66

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,12 @@
11
{
22
"name": "mbed-coap",
3-
"version": "4.0.0",
3+
"version": "4.0.2",
44
"description": "COAP library",
55
"keywords": [
66
"coap",
77
"nanostack"
88
],
99
"license": "Apache-2.0",
10-
"extraIncludes": [
11-
"source/include"
12-
],
1310
"dependencies": {
1411
"nanostack-libservice": "^3.0.0",
1512
"mbed-trace": ">=0.2.0,<2.0.0",
@@ -21,5 +18,9 @@
2118
"url": "https://github.com/ARMmbed/mbed-coap.git",
2219
"type": "git"
2320
},
24-
"homepage": "https://github.com/ARMmbed/mbed-coap"
21+
"homepage": "https://github.com/ARMmbed/mbed-coap",
22+
"extraIncludes": [
23+
"mbed-coap",
24+
"source/include"
25+
]
2526
}

features/FEATURE_COMMON_PAL/mbed-coap/source/sn_coap_parser.c

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -655,7 +655,7 @@ static int16_t sn_coap_parser_options_count_needed_memory_multiple_option(uint8_
655655
uint16_t i = 1;
656656

657657
/* Loop all Uri-Query options */
658-
while (i < packet_left_len) {
658+
while (i <= packet_left_len) {
659659
if (option == COAP_OPTION_LOCATION_PATH && option_number_len > 255) {
660660
return -1;
661661
}
@@ -677,14 +677,10 @@ static int16_t sn_coap_parser_options_count_needed_memory_multiple_option(uint8_
677677

678678
i += option_number_len;
679679
ret_value += option_number_len + 1; /* + 1 is for separator */
680-
if(ret_value >= packet_left_len)
681-
break;
682-
683-
if(ret_value >= packet_left_len)
684-
break;
685680

686-
if( i == packet_left_len )
681+
if( i >= packet_left_len ) {
687682
break;
683+
}
688684

689685
if ((*(packet_data_ptr + i) >> COAP_OPTIONS_OPTION_NUMBER_SHIFT) != 0) {
690686
return (ret_value - 1); /* -1 because last Part path does not include separator */

0 commit comments

Comments
 (0)