Skip to content

Commit aa2bef8

Browse files
committed
Issue #1272 - Applied the proposed fix for the CRC check of empty struct
1 parent e851b07 commit aa2bef8

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/apps/LoRaMac/common/NvmDataMgmt.c

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -186,9 +186,12 @@ uint16_t NvmDataMgmtRestore( void )
186186
offset += sizeof( SecureElementNvmData_t );
187187

188188
// Region group 1
189-
if( NvmmCrc32Check( sizeof( RegionNvmDataGroup1_t ), offset ) == false )
189+
if( sizeof( RegionNvmDataGroup1_t ) > sizeof( uint32_t ) )
190190
{
191-
return 0;
191+
if( NvmmCrc32Check( sizeof( RegionNvmDataGroup1_t ), offset ) == false )
192+
{
193+
return 0;
194+
}
192195
}
193196
offset += sizeof( RegionNvmDataGroup1_t );
194197

0 commit comments

Comments
 (0)