apache / mynewt-mcumgr

Apache mynewt
https://mynewt.apache.org/
99 stars 76 forks source link

cmd/img_mgmt: Fix compilation with dummy hash enabled #162

Closed sjanc closed 2 years ago

sjanc commented 2 years ago

Hash len is 32 bytes.

repos/apache-mynewt-mcumgr/cmd/img_mgmt/src/img_mgmt.c: In function ‘img_mgmt_read_info’: repos/apache-mynewt-mcumgr/cmd/img_mgmt/src/img_mgmt.c:122:9: error: ‘memcpy’ reading 32 bytes from a region of size 16 [-Werror=stringop-overread] 122 | memcpy(hash, dummy_hash, IMG_MGMT_HASH_LEN); | ^~~~~~~~~~~ repos/apache-mynewt-mcumgr/cmd/img_mgmt/src/img_mgmt.c:114:13: note: source object ‘dummy_hash’ of size 16 114 | uint8_t dummy_hash[] = {0x00, 0x11, 0x22, 0x33, 0x44, 0x55, 0x66, 0x77, | ^~~~~~ cc1: all warnings being treated as errors