You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mynewt.apache.org by GitBox <gi...@apache.org> on 2019/12/16 19:23:03 UTC

[GitHub] [mynewt-mcumgr] vrahane commented on a change in pull request #54: img_mgmt: TLVs were not getting parsed correctly

vrahane commented on a change in pull request #54: img_mgmt: TLVs were not getting parsed correctly
URL: https://github.com/apache/mynewt-mcumgr/pull/54#discussion_r358418940
 
 

 ##########
 File path: cmd/img_mgmt/src/img_mgmt.c
 ##########
 @@ -165,7 +165,15 @@ img_mgmt_read_info(int image_slot, struct image_version *ver, uint8_t *hash,
      * the hash is missing, the image is considered invalid.
      */
     data_off = hdr.ih_hdr_size + hdr.ih_img_size;
-    rc = img_mgmt_find_tlvs(&hdr, image_slot, &data_off, &data_end);
+
+    rc = img_mgmt_find_tlvs(image_slot, &data_off, &data_end, IMAGE_TLV_PROT_INFO_MAGIC);
+    if (rc != 0) {
+        return MGMT_ERR_EUNKNOWN;
+    }
+
+    data_off = data_end - sizeof(struct image_tlv_info);
 
 Review comment:
   done

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services