You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mynewt.apache.org by ma...@apache.org on 2016/12/08 01:44:59 UTC

incubator-mynewt-core git commit: oic; coap - remove length check on incoming data vs header info w/TCP hdrs. This must happen at transport level at reassembly time already.

Repository: incubator-mynewt-core
Updated Branches:
  refs/heads/develop e1fb47b80 -> 219c5e137


oic; coap - remove length check on incoming data vs header info w/TCP hdrs.
This must happen at transport level at reassembly time already.


Project: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/commit/219c5e13
Tree: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/tree/219c5e13
Diff: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/diff/219c5e13

Branch: refs/heads/develop
Commit: 219c5e137d1a94e172ac6d1fa1c63d78aba66d91
Parents: e1fb47b
Author: Marko Kiiskila <ma...@runtime.io>
Authored: Wed Dec 7 17:43:45 2016 -0800
Committer: Marko Kiiskila <ma...@runtime.io>
Committed: Wed Dec 7 17:43:45 2016 -0800

----------------------------------------------------------------------
 net/oic/src/messaging/coap/coap.c | 16 ----------------
 1 file changed, 16 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/219c5e13/net/oic/src/messaging/coap/coap.c
----------------------------------------------------------------------
diff --git a/net/oic/src/messaging/coap/coap.c b/net/oic/src/messaging/coap/coap.c
index dca8f5a..2230fba 100644
--- a/net/oic/src/messaging/coap/coap.c
+++ b/net/oic/src/messaging/coap/coap.c
@@ -529,33 +529,21 @@ coap_parse_message(coap_packet_t *pkt, uint8_t *data, uint16_t data_len,
         cth0 = (struct coap_tcp_hdr0 *)data;
         if (cth0->data_len < 13) {
             pkt->token_len = cth0->token_len;
-            if (data_len != cth0->data_len + sizeof(*cth0) + pkt->token_len) {
-                goto len_err;
-            }
             pkt->code = cth0->code;
             cur_opt = (uint8_t *)(cth0 + 1);
         } else if (cth0->data_len == 13) {
             cth8 = (struct coap_tcp_hdr8 *)data;
             pkt->token_len = cth8->token_len;
-            if (data_len != cth8->data_len + sizeof(*cth8) + pkt->token_len) {
-                goto len_err;
-            }
             pkt->code = cth8->code;
             cur_opt = (uint8_t *)(cth8 + 1);
         } else if (cth0->data_len == 14) {
             cth16 = (struct coap_tcp_hdr16 *)data;
             pkt->token_len = cth16->token_len;
-            if (data_len != cth16->data_len + sizeof(*cth16) + pkt->token_len) {
-                goto len_err;
-            }
             pkt->code = cth16->code;
             cur_opt = (uint8_t *)(cth16 + 1);
         } else {
             cth32 = (struct coap_tcp_hdr32 *)data;
             pkt->token_len = cth32->token_len;
-            if (data_len != cth32->data_len + sizeof(*cth32) + pkt->token_len) {
-                goto len_err;
-            }
             pkt->code = cth32->code;
             cur_opt = (uint8_t *)(cth32 + 1);
         }
@@ -766,10 +754,6 @@ coap_parse_message(coap_packet_t *pkt, uint8_t *data, uint16_t data_len,
     LOG("-Done parsing-------\n");
 
     return NO_ERROR;
-len_err:
-    STATS_INC(coap_stats, ierr);
-    coap_error_message = "Input len mismatch";
-    return BAD_REQUEST_4_00;
 }
 #if 0
 int