File tree Expand file tree Collapse file tree 2 files changed +15
-1
lines changed Expand file tree Collapse file tree 2 files changed +15
-1
lines changed Original file line number Diff line number Diff line change @@ -1364,19 +1364,32 @@ HRESULT CLR_RT_TypeDescriptor::ExtractTypeIndexFromObject(const CLR_RT_HeapBlock
13641364//
13651365static const char c_MARKER_ASSEMBLY_V1[] = " NFMRK1" ;
13661366
1367+ bool CLR_RECORD_ASSEMBLY::ValidateMarker () const
1368+ {
1369+ NATIVE_PROFILE_CLR_CORE ();
1370+
1371+ // compare the marker
1372+ return memcmp (marker, c_MARKER_ASSEMBLY_V1, sizeof (c_MARKER_ASSEMBLY_V1)) == 0 ;
1373+ }
1374+
13671375bool CLR_RECORD_ASSEMBLY::GoodHeader () const
13681376{
13691377 NATIVE_PROFILE_CLR_CORE ();
13701378 CLR_RECORD_ASSEMBLY header = *this ;
13711379 header.headerCRC = 0 ;
13721380
13731381 if (SUPPORT_ComputeCRC (&header, sizeof (header), 0 ) != this ->headerCRC )
1382+ {
1383+ // check for a wrong version of the marker
13741384 return false ;
1385+ }
13751386
13761387 if (this ->stringTableVersion != c_CLR_StringTable_Version)
1388+ {
13771389 return false ;
1390+ }
13781391
1379- return memcmp (marker, c_MARKER_ASSEMBLY_V1, sizeof (c_MARKER_ASSEMBLY_V1)) == 0 ;
1392+ return ValidateMarker () ;
13801393}
13811394
13821395bool CLR_RECORD_ASSEMBLY::GoodAssembly () const
Original file line number Diff line number Diff line change @@ -1011,6 +1011,7 @@ struct CLR_RECORD_ASSEMBLY
10111011
10121012 bool GoodHeader () const ;
10131013 bool GoodAssembly () const ;
1014+ bool ValidateMarker () const ;
10141015
10151016#if defined(VIRTUAL_DEVICE)
10161017 void ComputeCRC ();
You can’t perform that action at this time.
0 commit comments