edk2-20240813-2.fc42

List of Findings

Error: GCC_ANALYZER_WARNING (CWE-476): [#def1]
edk2-20240813-build/edk2-b158dad150bf/BaseTools/Source/C/Common/BasePeCoff.c: scope_hint: In function ‘PeCoffLoaderCheckImageType’
edk2-20240813-build/edk2-b158dad150bf/BaseTools/Source/C/Common/BasePeCoff.c:169:34: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘TeHdr’
#  167|       ImageContext->Machine = PeHdr->Pe32.FileHeader.Machine;

#  168|     } else {

#  169|->     ImageContext->Machine = TeHdr->Machine;

#  170|     }

#  171|   


Error: GCC_ANALYZER_WARNING (CWE-476): [#def2]
edk2-20240813-build/edk2-b158dad150bf/BaseTools/Source/C/Common/BasePeCoff.c: scope_hint: In function ‘PeCoffLoaderGetImageInfo’
edk2-20240813-build/edk2-b158dad150bf/BaseTools/Source/C/Common/BasePeCoff.c:277:59: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘TeHdr’
#  275|       }

#  276|     } else {

#  277|->     ImageContext->ImageAddress = (PHYSICAL_ADDRESS) (TeHdr->ImageBase + TeHdr->StrippedSize - sizeof (EFI_TE_IMAGE_HEADER));

#  278|     }

#  279|     //


Error: GCC_ANALYZER_WARNING (CWE-476): [#def3]
edk2-20240813-build/edk2-b158dad150bf/BaseTools/Source/C/Common/BasePeCoff.c: scope_hint: In function ‘PeCoffLoaderRelocateImage’
edk2-20240813-build/edk2-b158dad150bf/BaseTools/Source/C/Common/BasePeCoff.c:692:26: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘TeHdr’
edk2-20240813-build/edk2-b158dad150bf/BaseTools/Source/C/Common/BasePeCoff.c: scope_hint: In function ‘PeCoffLoaderRelocateImage’
edk2-20240813-build/edk2-b158dad150bf/BaseTools/Source/C/Common/BasePeCoff.c: scope_hint: In function ‘PeCoffLoaderRelocateImage’
#  690|                       RelocBase->VirtualAddress +

#  691|                       sizeof(EFI_TE_IMAGE_HEADER) -

#  692|->                     TeHdr->StrippedSize

#  693|                       );

#  694|       }


Error: GCC_ANALYZER_WARNING (CWE-688): [#def4]
edk2-20240813-build/edk2-b158dad150bf/BaseTools/Source/C/GenFw/GenFw.c:34: included_from: Included from here.
edk2-20240813-build/edk2-b158dad150bf/BaseTools/Source/C/GenFw/GenFw.c: scope_hint: In function ‘main’
edk2-20240813-build/edk2-b158dad150bf/BaseTools/Source/C/Common/CommonLib.h:449:17: warning[-Wanalyzer-null-argument]: use of NULL ‘ModuleType’ where non-null expected
edk2-20240813-build/edk2-b158dad150bf/BaseTools/Source/C/GenFw/GenFw.c:1499:11: note: in expansion of macro ‘stricmp’
edk2-20240813-build/edk2-b158dad150bf/BaseTools/Source/C/GenFw/GenFw.c:1242:7: note: in expansion of macro ‘stricmp’
edk2-20240813-build/edk2-b158dad150bf/BaseTools/Source/C/GenFw/GenFw.c:1248:10: note: in expansion of macro ‘stricmp’
edk2-20240813-build/edk2-b158dad150bf/BaseTools/Source/C/GenFw/GenFw.c:1259:10: note: in expansion of macro ‘stricmp’
edk2-20240813-build/edk2-b158dad150bf/BaseTools/Source/C/GenFw/GenFw.c:1276:10: note: in expansion of macro ‘stricmp’
edk2-20240813-build/edk2-b158dad150bf/BaseTools/Source/C/GenFw/GenFw.c:1283:10: note: in expansion of macro ‘stricmp’
edk2-20240813-build/edk2-b158dad150bf/BaseTools/Source/C/GenFw/GenFw.c:1290:10: note: in expansion of macro ‘stricmp’
edk2-20240813-build/edk2-b158dad150bf/BaseTools/Source/C/GenFw/GenFw.c:1300:10: note: in expansion of macro ‘stricmp’
edk2-20240813-build/edk2-b158dad150bf/BaseTools/Source/C/GenFw/GenFw.c:1307:10: note: in expansion of macro ‘stricmp’
edk2-20240813-build/edk2-b158dad150bf/BaseTools/Source/C/GenFw/GenFw.c:1314:10: note: in expansion of macro ‘stricmp’
edk2-20240813-build/edk2-b158dad150bf/BaseTools/Source/C/GenFw/GenFw.c:1326:10: note: in expansion of macro ‘stricmp’
edk2-20240813-build/edk2-b158dad150bf/BaseTools/Source/C/GenFw/GenFw.c:1338:10: note: in expansion of macro ‘stricmp’
edk2-20240813-build/edk2-b158dad150bf/BaseTools/Source/C/GenFw/GenFw.c:1345:9: note: in expansion of macro ‘stricmp’
edk2-20240813-build/edk2-b158dad150bf/BaseTools/Source/C/GenFw/GenFw.c:1352:9: note: in expansion of macro ‘stricmp’
edk2-20240813-build/edk2-b158dad150bf/BaseTools/Source/C/GenFw/GenFw.c:1359:9: note: in expansion of macro ‘stricmp’
edk2-20240813-build/edk2-b158dad150bf/BaseTools/Source/C/GenFw/GenFw.c:1366:10: note: in expansion of macro ‘stricmp’
edk2-20240813-build/edk2-b158dad150bf/BaseTools/Source/C/GenFw/GenFw.c:1373:10: note: in expansion of macro ‘stricmp’
edk2-20240813-build/edk2-b158dad150bf/BaseTools/Source/C/GenFw/GenFw.c:1380:10: note: in expansion of macro ‘stricmp’
edk2-20240813-build/edk2-b158dad150bf/BaseTools/Source/C/GenFw/GenFw.c:1391:10: note: in expansion of macro ‘stricmp’
edk2-20240813-build/edk2-b158dad150bf/BaseTools/Source/C/GenFw/GenFw.c:1410:10: note: in expansion of macro ‘stricmp’
edk2-20240813-build/edk2-b158dad150bf/BaseTools/Source/C/GenFw/GenFw.c:1429:10: note: in expansion of macro ‘stricmp’
edk2-20240813-build/edk2-b158dad150bf/BaseTools/Source/C/GenFw/GenFw.c:1440:10: note: in expansion of macro ‘stricmp’
edk2-20240813-build/edk2-b158dad150bf/BaseTools/Source/C/GenFw/GenFw.c:1448:10: note: in expansion of macro ‘stricmp’
edk2-20240813-build/edk2-b158dad150bf/BaseTools/Source/C/GenFw/GenFw.c:1456:10: note: in expansion of macro ‘stricmp’
edk2-20240813-build/edk2-b158dad150bf/BaseTools/Source/C/GenFw/GenFw.c:1473:10: note: in expansion of macro ‘stricmp’
edk2-20240813-build/edk2-b158dad150bf/BaseTools/Source/C/GenFw/GenFw.c:1484:9: note: in expansion of macro ‘stricmp’
edk2-20240813-build/edk2-b158dad150bf/BaseTools/Source/C/GenFw/GenFw.c:1491:9: note: in expansion of macro ‘stricmp’
edk2-20240813-build/edk2-b158dad150bf/BaseTools/Source/C/GenFw/GenFw.c:1498:9: note: in expansion of macro ‘stricmp’
edk2-20240813-build/edk2-b158dad150bf/BaseTools/Source/C/GenFw/GenFw.c:1499:11: note: in expansion of macro ‘stricmp’
edk2-20240813-build/edk2-b158dad150bf/BaseTools/Source/C/GenFw/GenFw.c:1499:11: note: in expansion of macro ‘stricmp’
/usr/include/string.h:462: included_from: Included from here.
edk2-20240813-build/edk2-b158dad150bf/BaseTools/Source/C/GenFw/GenFw.c:17: included_from: Included from here.
/usr/include/strings.h:116:12: note: argument 1 of ‘strcasecmp’ must be non-null
#  447|   #include <stdio.h>

#  448|   #include <sys/stat.h>

#  449|-> #define stricmp strcasecmp

#  450|   #define _stricmp strcasecmp

#  451|   #define strnicmp strncasecmp


Error: GCC_ANALYZER_WARNING (CWE-457): [#def5]
edk2-20240813-build/edk2-b158dad150bf/BaseTools/Source/C/Common/Decompress.c: scope_hint: In function ‘MakeTable’
edk2-20240813-build/edk2-b158dad150bf/BaseTools/Source/C/Common/Decompress.c:187:12: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value ‘Start[17]’
edk2-20240813-build/edk2-b158dad150bf/BaseTools/Source/C/Common/Decompress.c: scope_hint: In function ‘MakeTable’
edk2-20240813-build/edk2-b158dad150bf/BaseTools/Source/C/Common/Decompress.c: scope_hint: In function ‘MakeTable’
edk2-20240813-build/edk2-b158dad150bf/BaseTools/Source/C/Common/Decompress.c: scope_hint: In function ‘MakeTable’
edk2-20240813-build/edk2-b158dad150bf/BaseTools/Source/C/Common/Decompress.c:12: included_from: Included from here.
edk2-20240813-build/edk2-b158dad150bf/BaseTools/Source/C/Common/Decompress.c: scope_hint: In function ‘MakeTable’
#  185|     }

#  186|   

#  187|->   if (Start[17] != 0) {

#  188|       /*(1U << 16)*/

#  189|       return (UINT16) BAD_TABLE;


Error: GCC_ANALYZER_WARNING (CWE-126): [#def6]
edk2-20240813-build/edk2-b158dad150bf/BaseTools/Source/C/Common/EfiUtilityMsgs.c: scope_hint: In function ‘PrintMessage’
edk2-20240813-build/edk2-b158dad150bf/BaseTools/Source/C/Common/EfiUtilityMsgs.c:429:9: warning[-Wanalyzer-out-of-bounds]: buffer over-read
edk2-20240813-build/edk2-b158dad150bf/BaseTools/Source/C/Common/EfiUtilityMsgs.c:429:9: note: read of 461 bytes from after the end of ‘mUtilityName’
edk2-20240813-build/edk2-b158dad150bf/BaseTools/Source/C/Common/EfiUtilityMsgs.c:429:9: note: valid subscripts for ‘mUtilityName’ are ‘[0]’ to ‘[49]’
#  427|       } else {

#  428|         if (mUtilityName[0] != '\0') {

#  429|->         strncpy (Line, mUtilityName, MAX_LINE_LEN - 1);

#  430|           Line[MAX_LINE_LEN - 1] = 0;

#  431|         }


Error: GCC_ANALYZER_WARNING (CWE-465): [#def7]
edk2-20240813-build/edk2-b158dad150bf/BaseTools/Source/C/DevicePath/DevicePath.c: scope_hint: In function ‘main’
edk2-20240813-build/edk2-b158dad150bf/BaseTools/Source/C/DevicePath/DevicePath.c:169:6: warning[-Wanalyzer-deref-before-check]: check of ‘argv[1]’ for NULL after already dereferencing it
edk2-20240813-build/edk2-b158dad150bf/BaseTools/Source/C/DevicePath/UefiDevicePathLib.h:24: included_from: Included from here.
edk2-20240813-build/edk2-b158dad150bf/BaseTools/Source/C/DevicePath/DevicePath.c:9: included_from: Included from here.
edk2-20240813-build/edk2-b158dad150bf/BaseTools/Source/C/DevicePath/DevicePath.c:158:8: note: in expansion of macro ‘stricmp’
edk2-20240813-build/edk2-b158dad150bf/BaseTools/Source/C/DevicePath/DevicePath.c:158:8: note: in expansion of macro ‘stricmp’
edk2-20240813-build/edk2-b158dad150bf/BaseTools/Source/C/DevicePath/DevicePath.c:164:7: note: in expansion of macro ‘stricmp’
#  167|     }

#  168|     Str = argv[1];

#  169|->   if (Str == NULL) {

#  170|       fprintf(stderr, "Invalid option value, Device Path can't be NULL");

#  171|       return STATUS_ERROR;


Error: CPPCHECK_WARNING (CWE-628): [#def8]
edk2-20240813-build/edk2-b158dad150bf/BaseTools/Source/C/EfiRom/EfiRom.c:394: error[invalidFunctionArg]: Invalid putc() argument nr 1. The value is -1 but the valid values are '0:'.
#  392|     //

#  393|     while (TotalSize > 0) {

#  394|->     putc (~0, OutFptr);

#  395|       TotalSize--;

#  396|     }


Error: CPPCHECK_WARNING (CWE-628): [#def9]
edk2-20240813-build/edk2-b158dad150bf/BaseTools/Source/C/EfiRom/EfiRom.c:753: error[invalidFunctionArg]: Invalid putc() argument nr 1. The value is -1 but the valid values are '0:'.
#  751|     //

#  752|     while (PadBytesBeforeImage > 0) {

#  753|->     if (putc (~0, OutFptr) == EOF) {

#  754|         Error (NULL, 0, 2000, "Failed to write trailing pad bytes output file!", NULL);

#  755|         Status = STATUS_ERROR;


Error: CPPCHECK_WARNING (CWE-628): [#def10]
edk2-20240813-build/edk2-b158dad150bf/BaseTools/Source/C/EfiRom/EfiRom.c:773: error[invalidFunctionArg]: Invalid putc() argument nr 1. The value is -1 but the valid values are '0:'.
#  771|     //

#  772|     while (PadBytesAfterImage > 0) {

#  773|->     if (putc (~0, OutFptr) == EOF) {

#  774|         Error (NULL, 0, 2000, "Failed to write trailing pad bytes output file!", NULL);

#  775|         Status = STATUS_ERROR;


Error: CPPCHECK_WARNING (CWE-401): [#def11]
edk2-20240813-build/edk2-b158dad150bf/BaseTools/Source/C/GenFfs/GenFfs.c:777: error[memleakOnRealloc]: Common realloc mistake: 'InputFileName' nulled but not freed upon failure
#  775|           // InputFileName and alignment buffer too small, need to realloc

#  776|           //

#  777|->         InputFileName = (CHAR8 **) realloc (

#  778|                                       InputFileName,

#  779|                                       (InputFileNum + MAXIMUM_INPUT_FILE_NUM) * sizeof (CHAR8 *)


Error: CPPCHECK_WARNING (CWE-401): [#def12]
edk2-20240813-build/edk2-b158dad150bf/BaseTools/Source/C/GenFfs/GenFfs.c:789: error[memleakOnRealloc]: Common realloc mistake: 'InputFileAlign' nulled but not freed upon failure
#  787|           memset (&(InputFileName[InputFileNum]), 0, (MAXIMUM_INPUT_FILE_NUM * sizeof (CHAR8 *)));

#  788|   

#  789|->         InputFileAlign = (UINT32 *) realloc (

#  790|                                       InputFileAlign,

#  791|                                       (InputFileNum + MAXIMUM_INPUT_FILE_NUM) * sizeof (UINT32)


Error: GCC_ANALYZER_WARNING (CWE-688): [#def13]
edk2-20240813-build/edk2-b158dad150bf/BaseTools/Source/C/GenFw/Elf64Convert.c: scope_hint: In function ‘WriteSections64’
edk2-20240813-build/edk2-b158dad150bf/BaseTools/Source/C/GenFw/Elf64Convert.c:1383:15: warning[-Wanalyzer-null-argument]: use of NULL where non-null expected
edk2-20240813-build/edk2-b158dad150bf/BaseTools/Source/C/GenFw/Elf64Convert.c:20: included_from: Included from here.
/usr/include/string.h:156:12: note: argument 1 of ‘strcmp’ must be non-null
# 1381|           if (Sym->st_shndx == SHN_ABS) {

# 1382|             const UINT8 *SymName = GetSymName (Sym);

# 1383|->           if (strcmp ((CHAR8 *)SymName, "_GLOBAL_OFFSET_TABLE_") == 0) {

# 1384|               continue;

# 1385|             }


Error: CPPCHECK_WARNING (CWE-401): [#def14]
edk2-20240813-build/edk2-b158dad150bf/BaseTools/Source/C/GenFw/GenFw.c:1538: error[memleakOnRealloc]: Common realloc mistake: 'InputFileName' nulled but not freed upon failure
# 1536|         // InputFileName buffer too small, need to realloc

# 1537|         //

# 1538|->       InputFileName = (CHAR8 **) realloc (

# 1539|           InputFileName,

# 1540|           (InputFileNum + MAXIMUM_INPUT_FILE_NUM) * sizeof (CHAR8 *)


Error: CPPCHECK_WARNING (CWE-401): [#def15]
edk2-20240813-build/edk2-b158dad150bf/BaseTools/Source/C/GenSec/GenSec.c:1510: error[memleakOnRealloc]: Common realloc mistake: 'InputFileAlign' nulled but not freed upon failure
# 1508|           memset (InputFileAlign, 1, MAXIMUM_INPUT_FILE_NUM * sizeof (UINT32));

# 1509|         } else if (InputFileAlignNum % MAXIMUM_INPUT_FILE_NUM == 0) {

# 1510|->         InputFileAlign = (UINT32 *) realloc (

# 1511|             InputFileAlign,

# 1512|             (InputFileNum + MAXIMUM_INPUT_FILE_NUM) * sizeof (UINT32)


Error: CPPCHECK_WARNING (CWE-401): [#def16]
edk2-20240813-build/edk2-b158dad150bf/BaseTools/Source/C/GenSec/GenSec.c:1550: error[memleakOnRealloc]: Common realloc mistake: 'InputFileName' nulled but not freed upon failure
# 1548|         // InputFileName buffer too small, need to realloc

# 1549|         //

# 1550|->       InputFileName = (CHAR8 **) realloc (

# 1551|                                     InputFileName,

# 1552|                                     (InputFileNum + MAXIMUM_INPUT_FILE_NUM) * sizeof (CHAR8 *)


Error: GCC_ANALYZER_WARNING (CWE-457): [#def17]
edk2-20240813-build/edk2-b158dad150bf/BaseTools/Source/C/LzmaCompress/Sdk/C/LzmaDec.c: scope_hint: In function ‘LzmaDec_DecodeToDic’
edk2-20240813-build/edk2-b158dad150bf/BaseTools/Source/C/LzmaCompress/Sdk/C/LzmaDec.c:895:28: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value ‘*p.tempBuf[1]’
edk2-20240813-build/edk2-b158dad150bf/BaseTools/Source/C/LzmaCompress/Sdk/C/LzmaDec.c:9: included_from: Included from here.
edk2-20240813-build/edk2-b158dad150bf/BaseTools/Source/C/LzmaCompress/Sdk/C/LzmaDec.c:1173:3: note: in expansion of macro ‘LzmaDec_Construct’
edk2-20240813-build/edk2-b158dad150bf/BaseTools/Source/C/LzmaCompress/Sdk/C/LzmaDec.h:7: included_from: Included from here.
edk2-20240813-build/edk2-b158dad150bf/BaseTools/Source/C/LzmaCompress/Sdk/C/7zTypes.h:63:38: note: in definition of macro ‘RINOK’
edk2-20240813-build/edk2-b158dad150bf/BaseTools/Source/C/LzmaCompress/Sdk/C/LzmaDec.c:1124:3: note: in expansion of macro ‘RINOK’
edk2-20240813-build/edk2-b158dad150bf/BaseTools/Source/C/LzmaCompress/Sdk/C/7zTypes.h:63:38: note: in definition of macro ‘RINOK’
edk2-20240813-build/edk2-b158dad150bf/BaseTools/Source/C/LzmaCompress/Sdk/C/7zTypes.h:63:38: note: in definition of macro ‘RINOK’
edk2-20240813-build/edk2-b158dad150bf/BaseTools/Source/C/LzmaCompress/Sdk/C/LzmaDec.c:1064:3: note: in expansion of macro ‘ISzAlloc_Free’
edk2-20240813-build/edk2-b158dad150bf/BaseTools/Source/C/LzmaCompress/Sdk/C/LzmaDec.c: scope_hint: In function ‘LzmaDec_DecodeToDic’
edk2-20240813-build/edk2-b158dad150bf/BaseTools/Source/C/LzmaCompress/Sdk/C/7zTypes.h:63:38: note: in definition of macro ‘RINOK’
edk2-20240813-build/edk2-b158dad150bf/BaseTools/Source/C/LzmaCompress/Sdk/C/LzmaDec.c:1125:3: note: in expansion of macro ‘RINOK’
edk2-20240813-build/edk2-b158dad150bf/BaseTools/Source/C/LzmaCompress/Sdk/C/7zTypes.h:63:38: note: in definition of macro ‘RINOK’
edk2-20240813-build/edk2-b158dad150bf/BaseTools/Source/C/LzmaCompress/Sdk/C/LzmaDec.c:1174:3: note: in expansion of macro ‘RINOK’
#  893|       }

#  894|       p->code =

#  895|->         ((UInt32)p->tempBuf[1] << 24)

#  896|         | ((UInt32)p->tempBuf[2] << 16)

#  897|         | ((UInt32)p->tempBuf[3] << 8)


Error: GCC_ANALYZER_WARNING (CWE-457): [#def18]
edk2-20240813-build/edk2-b158dad150bf/BaseTools/Source/C/TianoCompress/TianoCompress.c: scope_hint: In function ‘MakeTable’
edk2-20240813-build/edk2-b158dad150bf/BaseTools/Source/C/TianoCompress/TianoCompress.c:2234:12: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value ‘Start[17]’
edk2-20240813-build/edk2-b158dad150bf/BaseTools/Source/C/TianoCompress/TianoCompress.c:19: included_from: Included from here.
edk2-20240813-build/edk2-b158dad150bf/BaseTools/Source/C/TianoCompress/TianoCompress.c: scope_hint: In function ‘MakeTable’
# 2232|     }

# 2233|   

# 2234|->   if (Start[17] != 0) {

# 2235|       //

# 2236|       //(1U << 16)


Error: CPPCHECK_WARNING (CWE-457): [#def19]
edk2-20240813-build/edk2-b158dad150bf/BaseTools/Source/C/VfrCompile/Pccts/antlr/antlr.c:36: error[uninitvar]: Uninitialized variable: a
#   34|   #endif

#   35|   

#   36|-> ANTLR_INFO

#   37|   

#   38|   


Error: CPPCHECK_WARNING (CWE-457): [#def20]
edk2-20240813-build/edk2-b158dad150bf/BaseTools/Source/C/VfrCompile/Pccts/antlr/antlr.c:1394: error[legacyUninitvar]: Uninitialized variable: p
# 1392|     }

# 1393|     

# 1394|->   /* MR23 */         if (p!= NULL && akaString != NULL) {

# 1395|       /* MR23 */           if (p->akaString != NULL) {

# 1396|         /* MR23 */             if (strcmp(p->akaString,akaString) != 0) {


Error: GCC_ANALYZER_WARNING (CWE-476): [#def21]
edk2-20240813-build/edk2-b158dad150bf/BaseTools/Source/C/VfrCompile/Pccts/antlr/bits.c: scope_hint: In function ‘GenParser_c_Hdr’
edk2-20240813-build/edk2-b158dad150bf/BaseTools/Source/C/VfrCompile/Pccts/antlr/bits.c:704:53: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘hasAkaName’
edk2-20240813-build/edk2-b158dad150bf/BaseTools/Source/C/VfrCompile/Pccts/antlr/bits.c:38: included_from: Included from here.
edk2-20240813-build/edk2-b158dad150bf/BaseTools/Source/C/VfrCompile/Pccts/antlr/bits.c:703:9: note: in expansion of macro ‘require’
edk2-20240813-build/edk2-b158dad150bf/BaseTools/Source/C/VfrCompile/Pccts/antlr/bits.c:703:9: note: in expansion of macro ‘require’
edk2-20240813-build/edk2-b158dad150bf/BaseTools/Source/C/VfrCompile/Pccts/antlr/generic.h:60:44: note: in expansion of macro ‘fatal_internal’
edk2-20240813-build/edk2-b158dad150bf/BaseTools/Source/C/VfrCompile/Pccts/antlr/bits.c:703:9: note: in expansion of macro ‘require’
#  702|   	hasAkaName = (char *) malloc(TokenNum+1);					/* MR23 */

#  703|   	require(hasAkaName!=NULL, "Cannot alloc hasAkaName\n");		/* MR23 */

#  704|-> 	for (i = 0; i < TokenNum; i++) hasAkaName[i]='0';			/* MR23 */

#  705|   	hasAkaName[TokenNum] = 0;                                   /* MR23 */

#  706|   


Error: CPPCHECK_WARNING (CWE-401): [#def22]
edk2-20240813-build/edk2-b158dad150bf/BaseTools/Source/C/VfrCompile/Pccts/antlr/build.c:75: error[memleak]: Memory leak: q
#   73|   	}

#   74|   	else fatal_internal("addParm: invalid node for adding parm");

#   75|-> }

#   76|   

#   77|   /*


Error: GCC_ANALYZER_WARNING (CWE-476): [#def23]
edk2-20240813-build/edk2-b158dad150bf/BaseTools/Source/C/VfrCompile/Pccts/antlr/build.c: scope_hint: In function ‘makePlus’
edk2-20240813-build/edk2-b158dad150bf/BaseTools/Source/C/VfrCompile/Pccts/antlr/build.c:543:16: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘j3’
edk2-20240813-build/edk2-b158dad150bf/BaseTools/Source/C/VfrCompile/Pccts/antlr/build.c:38: included_from: Included from here.
edk2-20240813-build/edk2-b158dad150bf/BaseTools/Source/C/VfrCompile/Pccts/antlr/build.c:737:9: note: in expansion of macro ‘require’
edk2-20240813-build/edk2-b158dad150bf/BaseTools/Source/C/VfrCompile/Pccts/antlr/build.c:737:9: note: in expansion of macro ‘require’
edk2-20240813-build/edk2-b158dad150bf/BaseTools/Source/C/VfrCompile/Pccts/antlr/build.c:792:9: note: in expansion of macro ‘require’
edk2-20240813-build/edk2-b158dad150bf/BaseTools/Source/C/VfrCompile/Pccts/antlr/build.c:792:9: note: in expansion of macro ‘require’
edk2-20240813-build/edk2-b158dad150bf/BaseTools/Source/C/VfrCompile/Pccts/antlr/build.c:792:9: note: in expansion of macro ‘require’
edk2-20240813-build/edk2-b158dad150bf/BaseTools/Source/C/VfrCompile/Pccts/antlr/generic.h:60:44: note: in expansion of macro ‘fatal_internal’
edk2-20240813-build/edk2-b158dad150bf/BaseTools/Source/C/VfrCompile/Pccts/antlr/build.c:792:9: note: in expansion of macro ‘require’
#  541|   	((Junction *)g1.left)->lock = makelocks();

#  542|   	((Junction *)g1.left)->pred_lock = makelocks();

#  543|-> 	j3->p1 = g1.left;							/* add node to front */

#  544|   	g1.left = (Node *) j3;

#  545|   


Error: GCC_ANALYZER_WARNING (CWE-476): [#def24]
edk2-20240813-build/edk2-b158dad150bf/BaseTools/Source/C/VfrCompile/Pccts/antlr/build.c: scope_hint: In function ‘newTokNode’
edk2-20240813-build/edk2-b158dad150bf/BaseTools/Source/C/VfrCompile/Pccts/antlr/build.c:650:33: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘p’
edk2-20240813-build/edk2-b158dad150bf/BaseTools/Source/C/VfrCompile/Pccts/antlr/build.c:647:25: note: in expansion of macro ‘fatal_internal’
#  648|   		for (p=newblk; p<&(newblk[TokenBlockAllocSize]); p++)

#  649|   		{

#  650|-> 			p->next = (Node *)FreeList;	/* add all new token nodes to FreeList */

#  651|   			FreeList = p;

#  652|   		}


Error: GCC_ANALYZER_WARNING (CWE-401): [#def25]
edk2-20240813-build/edk2-b158dad150bf/BaseTools/Source/C/VfrCompile/Pccts/antlr/build.c:664:16: warning[-Wanalyzer-malloc-leak]: leak of ‘p’
#  662|   	p->altstart = NULL;

#  663|   

#  664|-> 	return p;

#  665|   }

#  666|   


Error: GCC_ANALYZER_WARNING (CWE-476): [#def26]
edk2-20240813-build/edk2-b158dad150bf/BaseTools/Source/C/VfrCompile/Pccts/antlr/build.c: scope_hint: In function ‘newRNode’
edk2-20240813-build/edk2-b158dad150bf/BaseTools/Source/C/VfrCompile/Pccts/antlr/build.c:684:33: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘p’
edk2-20240813-build/edk2-b158dad150bf/BaseTools/Source/C/VfrCompile/Pccts/antlr/build.c:681:25: note: in expansion of macro ‘fatal_internal’
#  682|   		for (p=newblk; p<&(newblk[RRefBlockAllocSize]); p++)

#  683|   		{

#  684|-> 			p->next = (Node *)FreeList;	/* add all new rref nodes to FreeList */

#  685|   			FreeList = p;

#  686|   		}


Error: GCC_ANALYZER_WARNING (CWE-401): [#def27]
edk2-20240813-build/edk2-b158dad150bf/BaseTools/Source/C/VfrCompile/Pccts/antlr/build.c:699:16: warning[-Wanalyzer-malloc-leak]: leak of ‘p’
#  697|   	p->altstart = NULL;

#  698|   	

#  699|-> 	return p;

#  700|   }

#  701|   


Error: GCC_ANALYZER_WARNING (CWE-476): [#def28]
edk2-20240813-build/edk2-b158dad150bf/BaseTools/Source/C/VfrCompile/Pccts/antlr/build.c: scope_hint: In function ‘newJunction’
edk2-20240813-build/edk2-b158dad150bf/BaseTools/Source/C/VfrCompile/Pccts/antlr/build.c:721:31: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘p’
edk2-20240813-build/edk2-b158dad150bf/BaseTools/Source/C/VfrCompile/Pccts/antlr/build.c:718:25: note: in expansion of macro ‘fatal_internal’
#  719|   		for (p=newblk; p<&(newblk[JunctionBlockAllocSize]); p++)

#  720|   		{

#  721|-> 			p->p1 = (Node *)FreeList;	/* add all new Junction nodes to FreeList */

#  722|   			FreeList = p;

#  723|   		}


Error: GCC_ANALYZER_WARNING (CWE-401): [#def29]
edk2-20240813-build/edk2-b158dad150bf/BaseTools/Source/C/VfrCompile/Pccts/antlr/build.c:740:16: warning[-Wanalyzer-malloc-leak]: leak of ‘p’
edk2-20240813-build/edk2-b158dad150bf/BaseTools/Source/C/VfrCompile/Pccts/antlr/build.c:737:9: note: in expansion of macro ‘require’
#  738|       p->seq=++junctionSeqNumber;     /* MR10 */

#  739|   

#  740|-> 	return p;

#  741|   }

#  742|   


Error: GCC_ANALYZER_WARNING (CWE-476): [#def30]
edk2-20240813-build/edk2-b158dad150bf/BaseTools/Source/C/VfrCompile/Pccts/antlr/build.c: scope_hint: In function ‘newActionNode’
edk2-20240813-build/edk2-b158dad150bf/BaseTools/Source/C/VfrCompile/Pccts/antlr/build.c:760:33: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘p’
edk2-20240813-build/edk2-b158dad150bf/BaseTools/Source/C/VfrCompile/Pccts/antlr/build.c:757:25: note: in expansion of macro ‘fatal_internal’
#  758|   		for (p=newblk; p<&(newblk[ActionBlockAllocSize]); p++)

#  759|   		{

#  760|-> 			p->next = (Node *)FreeList;	/* add all new Action nodes to FreeList */

#  761|   			FreeList = p;

#  762|   		}


Error: GCC_ANALYZER_WARNING (CWE-401): [#def31]
edk2-20240813-build/edk2-b158dad150bf/BaseTools/Source/C/VfrCompile/Pccts/antlr/build.c:773:16: warning[-Wanalyzer-malloc-leak]: leak of ‘p’
#  771|   	p->guardpred = NULL;

#  772|       p->ampersandPred = NULL;

#  773|-> 	return p;

#  774|   }

#  775|   


Error: GCC_ANALYZER_WARNING (CWE-476): [#def32]
edk2-20240813-build/edk2-b158dad150bf/BaseTools/Source/C/VfrCompile/Pccts/antlr/egman.c: scope_hint: In function ‘arrayCheck’
edk2-20240813-build/edk2-b158dad150bf/BaseTools/Source/C/VfrCompile/Pccts/antlr/egman.c:239:20: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘egArrayNew’
#  237|           calloc(arraySizeNew,sizeof(Junction *));

#  238|       for (i=0; i<arraySize ; i++) {

#  239|->       egArrayNew[i]=egArray[i];

#  240|         leArrayNew[i]=leArray[i];

#  241|         altArrayNew[i]=altArray[i];


Error: GCC_ANALYZER_WARNING (CWE-476): [#def33]
edk2-20240813-build/edk2-b158dad150bf/BaseTools/Source/C/VfrCompile/Pccts/antlr/egman.c:240:20: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘leArrayNew’
#  238|       for (i=0; i<arraySize ; i++) {

#  239|         egArrayNew[i]=egArray[i];

#  240|->       leArrayNew[i]=leArray[i];

#  241|         altArrayNew[i]=altArray[i];

#  242|       };


Error: GCC_ANALYZER_WARNING (CWE-476): [#def34]
edk2-20240813-build/edk2-b158dad150bf/BaseTools/Source/C/VfrCompile/Pccts/antlr/egman.c:241:21: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘altArrayNew’
#  239|         egArrayNew[i]=egArray[i];

#  240|         leArrayNew[i]=leArray[i];

#  241|->       altArrayNew[i]=altArray[i];

#  242|       };

#  243|       arraySize=arraySizeNew;


Error: GCC_ANALYZER_WARNING (CWE-476): [#def35]
edk2-20240813-build/edk2-b158dad150bf/BaseTools/Source/C/VfrCompile/Pccts/antlr/fset2.c: scope_hint: In function ‘tnode’
edk2-20240813-build/edk2-b158dad150bf/BaseTools/Source/C/VfrCompile/Pccts/antlr/fset2.c:275:17: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘p’
edk2-20240813-build/edk2-b158dad150bf/BaseTools/Source/C/VfrCompile/Pccts/antlr/fset2.c:46: included_from: Included from here.
edk2-20240813-build/edk2-b158dad150bf/BaseTools/Source/C/VfrCompile/Pccts/antlr/fset2.c:1798:5: note: in expansion of macro ‘require’
#  273|   	FreeList = FreeList->right;		/* remove a tree node */

#  274|   	p->right = NULL;				/* zero out ptrs */

#  275|-> 	p->down = NULL;

#  276|   	p->token = tok;

#  277|   


Error: GCC_ANALYZER_WARNING (CWE-476): [#def36]
edk2-20240813-build/edk2-b158dad150bf/BaseTools/Source/C/VfrCompile/Pccts/antlr/fset2.c: scope_hint: In function ‘MR_traceAmbSource’
edk2-20240813-build/edk2-b158dad150bf/BaseTools/Source/C/VfrCompile/Pccts/antlr/fset2.c:2003:61: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘dup_matchSets’
edk2-20240813-build/edk2-b158dad150bf/BaseTools/Source/C/VfrCompile/Pccts/antlr/fset2.c:1960:5: note: in expansion of macro ‘require’
edk2-20240813-build/edk2-b158dad150bf/BaseTools/Source/C/VfrCompile/Pccts/antlr/fset2.c:1960:5: note: in expansion of macro ‘require’
edk2-20240813-build/edk2-b158dad150bf/BaseTools/Source/C/VfrCompile/Pccts/antlr/generic.h:60:44: note: in expansion of macro ‘fatal_internal’
edk2-20240813-build/edk2-b158dad150bf/BaseTools/Source/C/VfrCompile/Pccts/antlr/fset2.c:1960:5: note: in expansion of macro ‘require’
# 2001|   /***        fprintf(stdout,"  Choice:%d  Depth:%d\n\n",i+1,depth);  ***/

# 2002|   

# 2003|->             for (j=0 ; j <= CLL_k ; j++) { dup_matchSets[j]=set_dup(matchSets[j]); };

# 2004|               fset=dup_matchSets;

# 2005|   


Error: GCC_ANALYZER_WARNING (CWE-688): [#def37]
edk2-20240813-build/edk2-b158dad150bf/BaseTools/Source/C/VfrCompile/Pccts/antlr/lex.c: scope_hint: In function ‘genLexDescr’
edk2-20240813-build/edk2-b158dad150bf/BaseTools/Source/C/VfrCompile/Pccts/antlr/lex.c:58:9: warning[-Wanalyzer-null-argument]: use of NULL ‘dlgFile’ where non-null expected
edk2-20240813-build/edk2-b158dad150bf/BaseTools/Source/C/VfrCompile/Pccts/antlr/lex.c:40: included_from: Included from here.
edk2-20240813-build/edk2-b158dad150bf/BaseTools/Source/C/VfrCompile/Pccts/antlr/lex.c:54:9: note: in expansion of macro ‘require’
edk2-20240813-build/edk2-b158dad150bf/BaseTools/Source/C/VfrCompile/Pccts/antlr/lex.c:54:9: note: in expansion of macro ‘require’
edk2-20240813-build/edk2-b158dad150bf/BaseTools/Source/C/VfrCompile/Pccts/antlr/generic.h:60:44: note: in expansion of macro ‘fatal_internal’
edk2-20240813-build/edk2-b158dad150bf/BaseTools/Source/C/VfrCompile/Pccts/antlr/lex.c:54:9: note: in expansion of macro ‘require’
<built-in>: note: argument 4 of ‘__builtin_fwrite’ must be non-null
#   56|   	special_fopen_actions(OutMetaName(DlgFileName));	             /* MR1 */

#   57|   #endif

#   58|-> 	fprintf(dlgFile, "<<\n");

#   59|   	fprintf(dlgFile, "/* %s -- DLG Description of scanner\n", DlgFileName);

#   60|   	fprintf(dlgFile, " *\n");


Error: GCC_ANALYZER_WARNING (CWE-688): [#def38]
edk2-20240813-build/edk2-b158dad150bf/BaseTools/Source/C/VfrCompile/Pccts/antlr/lex.c: scope_hint: In function ‘GenRemapFile’
edk2-20240813-build/edk2-b158dad150bf/BaseTools/Source/C/VfrCompile/Pccts/antlr/lex.c:365:17: warning[-Wanalyzer-null-argument]: use of NULL ‘f’ where non-null expected
edk2-20240813-build/edk2-b158dad150bf/BaseTools/Source/C/VfrCompile/Pccts/antlr/lex.c:361:17: note: in expansion of macro ‘require’
edk2-20240813-build/edk2-b158dad150bf/BaseTools/Source/C/VfrCompile/Pccts/antlr/lex.c:361:17: note: in expansion of macro ‘require’
edk2-20240813-build/edk2-b158dad150bf/BaseTools/Source/C/VfrCompile/Pccts/antlr/generic.h:60:44: note: in expansion of macro ‘fatal_internal’
edk2-20240813-build/edk2-b158dad150bf/BaseTools/Source/C/VfrCompile/Pccts/antlr/lex.c:361:17: note: in expansion of macro ‘require’
edk2-20240813-build/edk2-b158dad150bf/BaseTools/Source/C/VfrCompile/Pccts/antlr/lex.c:31: included_from: Included from here.
/usr/include/stdio.h:357:12: note: argument 1 of ‘fprintf’ must be non-null
#  363|   		special_fopen_actions(OutMetaName(RemapFileName));           /* MR1 */

#  364|   #endif

#  365|-> 		fprintf(f, "/* %s -- List of symbols to remap\n", RemapFileName);

#  366|   		fprintf(f, " *\n");

#  367|   		fprintf(f, " * Generated from:");


Error: GCC_ANALYZER_WARNING (CWE-688): [#def39]
edk2-20240813-build/edk2-b158dad150bf/BaseTools/Source/C/VfrCompile/Pccts/antlr/main.c: scope_hint: In function ‘newUserAction’
edk2-20240813-build/edk2-b158dad150bf/BaseTools/Source/C/VfrCompile/Pccts/antlr/main.c:1707:9: warning[-Wanalyzer-possible-null-argument]: use of possibly-NULL ‘calloc(strlen(zzlextext) + 1, 1)’ where non-null expected
edk2-20240813-build/edk2-b158dad150bf/BaseTools/Source/C/VfrCompile/Pccts/antlr/stdpccts.h:24: included_from: Included from here.
edk2-20240813-build/edk2-b158dad150bf/BaseTools/Source/C/VfrCompile/Pccts/antlr/main.c:37: included_from: Included from here.
edk2-20240813-build/edk2-b158dad150bf/BaseTools/Source/C/VfrCompile/Pccts/antlr/main.c:1704:9: note: in expansion of macro ‘require’
<built-in>: note: argument 1 of ‘__builtin_strcpy’ must be non-null
# 1705|   

# 1706|   	ua->action = (char *) calloc(strlen(LATEXT(1))+1, sizeof(char));

# 1707|-> 	strcpy(ua->action, s);

# 1708|   	return ua;

# 1709|   }


Error: GCC_ANALYZER_WARNING (CWE-688): [#def40]
edk2-20240813-build/edk2-b158dad150bf/BaseTools/Source/C/VfrCompile/Pccts/antlr/main.c: scope_hint: In function ‘makeAltID’
edk2-20240813-build/edk2-b158dad150bf/BaseTools/Source/C/VfrCompile/Pccts/antlr/main.c:1745:9: warning[-Wanalyzer-possible-null-argument]: use of possibly-NULL ‘p’ where non-null expected
<built-in>: note: argument 1 of ‘__builtin_strcpy’ must be non-null
# 1743|   	sprintf(buf, "_blk%d_alt%d", blockid, altnum);

# 1744|   	p = (char *)malloc(strlen(buf)+1);

# 1745|-> 	strcpy(p, buf);

# 1746|   	return p;

# 1747|   }


Error: CPPCHECK_WARNING (CWE-401): [#def41]
edk2-20240813-build/edk2-b158dad150bf/BaseTools/Source/C/VfrCompile/Pccts/antlr/misc.c:95: error[memleakOnRealloc]: Common realloc mistake: 'TokenStr' nulled but not freed upon failure
#   93|   		more = TSChunk * (1 + ((TokenNum-tsize) / TSChunk));

#   94|   		tsize += more;

#   95|-> 		TokenStr = (char **) realloc((char *)TokenStr, tsize*sizeof(char *));

#   96|   		require(TokenStr != NULL, "Ttrack: can't extend TokenStr");

#   97|   		for (i=0; i<NumLexClasses; i++)


Error: GCC_ANALYZER_WARNING (CWE-476): [#def42]
edk2-20240813-build/edk2-b158dad150bf/BaseTools/Source/C/VfrCompile/Pccts/antlr/pred.c: scope_hint: In function ‘new_pred’
edk2-20240813-build/edk2-b158dad150bf/BaseTools/Source/C/VfrCompile/Pccts/antlr/pred.c:595:22: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘p’
edk2-20240813-build/edk2-b158dad150bf/BaseTools/Source/C/VfrCompile/Pccts/antlr/pred.c:36: included_from: Included from here.
edk2-20240813-build/edk2-b158dad150bf/BaseTools/Source/C/VfrCompile/Pccts/antlr/pred.c:592:9: note: in expansion of macro ‘require’
edk2-20240813-build/edk2-b158dad150bf/BaseTools/Source/C/VfrCompile/Pccts/antlr/pred.c:592:9: note: in expansion of macro ‘require’
edk2-20240813-build/edk2-b158dad150bf/BaseTools/Source/C/VfrCompile/Pccts/antlr/generic.h:60:44: note: in expansion of macro ‘fatal_internal’
edk2-20240813-build/edk2-b158dad150bf/BaseTools/Source/C/VfrCompile/Pccts/antlr/pred.c:592:9: note: in expansion of macro ‘require’
#  593|       p->scontext[0]=empty;

#  594|       p->scontext[1]=empty;

#  595|->     p->completionTree=empty;

#  596|       p->completionSet=empty;

#  597|       p->plainSet=empty;


Error: CPPCHECK_WARNING (CWE-401): [#def43]
edk2-20240813-build/edk2-b158dad150bf/BaseTools/Source/C/VfrCompile/Pccts/dlg/automata.c:100: error[memleakOnRealloc]: Common realloc mistake: 'dfa_array' nulled but not freed upon failure
#   98|   			/* need more space */

#   99|   			dfa_size=2*(dfa_allocated+1);

#  100|-> 			dfa_array=(dfa_node **) realloc(dfa_array,

#  101|   				sizeof(dfa_node*)*dfa_size);

#  102|   		}


Error: CPPCHECK_WARNING (CWE-401): [#def44]
edk2-20240813-build/edk2-b158dad150bf/BaseTools/Source/C/VfrCompile/Pccts/dlg/automata.c:139: error[memleak]: Memory leak: reach_list
#  137|   

#  138|   	reach_list = (unsigned *) malloc((2+nfa_allocated)*sizeof(unsigned));

#  139|-> 	if (!start) return NULL;

#  140|   	t = set_of(NFA_NO(start));

#  141|   	_set_pdq(t,reach_list);


Error: CPPCHECK_WARNING (CWE-401): [#def45]
edk2-20240813-build/edk2-b158dad150bf/BaseTools/Source/C/VfrCompile/Pccts/dlg/dlg_p.c:823: error[memleakOnRealloc]: Common realloc mistake: 'nfa_array' nulled but not freed upon failure
#  821|         /* need more space */

#  822|         nfa_size=2*(nfa_allocated+1);

#  823|->       nfa_array=(nfa_node **) realloc(nfa_array,

#  824|         sizeof(nfa_node*)*nfa_size);

#  825|       }


Error: GCC_ANALYZER_WARNING (CWE-401): [#def46]
edk2-20240813-build/edk2-b158dad150bf/BaseTools/Source/C/VfrCompile/Pccts/dlg/dlg_p.c: scope_hint: In function ‘new_nfa_node’
edk2-20240813-build/edk2-b158dad150bf/BaseTools/Source/C/VfrCompile/Pccts/dlg/dlg_p.c:823:16: warning[-Wanalyzer-malloc-leak]: leak of ‘nfa_array’
edk2-20240813-build/edk2-b158dad150bf/BaseTools/Source/C/VfrCompile/Pccts/dlg/dlg_p.c:20: included_from: Included from here.
edk2-20240813-build/edk2-b158dad150bf/BaseTools/Source/C/VfrCompile/Pccts/h/antlr.h:515:35: note: in expansion of macro ‘zzOvfChk’
edk2-20240813-build/edk2-b158dad150bf/BaseTools/Source/C/VfrCompile/Pccts/dlg/dlg_p.c:477:3: note: in expansion of macro ‘zzMake0’
edk2-20240813-build/edk2-b158dad150bf/BaseTools/Source/C/VfrCompile/Pccts/dlg/dlg_p.c:477:3: note: in expansion of macro ‘zzMake0’
#  821|         /* need more space */

#  822|         nfa_size=2*(nfa_allocated+1);

#  823|->       nfa_array=(nfa_node **) realloc(nfa_array,

#  824|         sizeof(nfa_node*)*nfa_size);

#  825|       }


Error: GCC_ANALYZER_WARNING (CWE-476): [#def47]
edk2-20240813-build/edk2-b158dad150bf/BaseTools/Source/C/VfrCompile/Pccts/dlg/dlg_p.c:830:6: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘t’
#  828|     t = (nfa_node*) malloc(sizeof(nfa_node));

#  829|     nfa_array[nfa_allocated] = t;

#  830|->   *t = nfa_model_node;

#  831|     t->node_no = nfa_allocated;

#  832|     return t;


Error: GCC_ANALYZER_WARNING (CWE-688): [#def48]
edk2-20240813-build/edk2-b158dad150bf/BaseTools/Source/C/VfrCompile/Pccts/dlg/output.c: scope_hint: In function ‘mystrdup’
edk2-20240813-build/edk2-b158dad150bf/BaseTools/Source/C/VfrCompile/Pccts/dlg/output.c:139:9: warning[-Wanalyzer-possible-null-argument]: use of possibly-NULL ‘p’ where non-null expected
<built-in>: note: argument 1 of ‘__builtin_strcpy’ must be non-null
#  137|   {

#  138|   	char *p = (char *)malloc(strlen(s)+1);

#  139|-> 	strcpy(p, s);

#  140|   	return p;

#  141|   }


Error: COMPILER_WARNING: [#def49]
edk2-20240813-build/edk2-b158dad150bf/BaseTools/Source/C/VfrCompile/Pccts/h/AParser.cpp:49:6: warning[-Wodr]: type ‘ANTLRTokenType’ violates the C++ One Definition Rule
#   49 | enum ANTLRTokenType { TER_HATES_CPP=0, ITS_TOO_COMPLICATED=9999};           // MR1
#      |      ^
edk2-20240813-build/edk2-b158dad150bf/BaseTools/Source/C/VfrCompile/Pccts/h/DLexerBase.cpp:47:6: note: an enum with different value name is defined in another translation unit
#   47 | enum ANTLRTokenType { TER_HATES_CPP=0, ITS_UTTER_GARBAGE,               // MR1
#      |      ^
edk2-20240813-build/edk2-b158dad150bf/BaseTools/Source/C/VfrCompile/Pccts/h/AParser.cpp:49:40: note: name ‘ITS_TOO_COMPLICATED’ differs from name ‘ITS_UTTER_GARBAGE’ defined in another translation unit
#   49 | enum ANTLRTokenType { TER_HATES_CPP=0, ITS_TOO_COMPLICATED=9999};           // MR1
#      |                                        ^
edk2-20240813-build/edk2-b158dad150bf/BaseTools/Source/C/VfrCompile/Pccts/h/DLexerBase.cpp:47:40: note: mismatching definition
#   47 | enum ANTLRTokenType { TER_HATES_CPP=0, ITS_UTTER_GARBAGE,               // MR1
#      |                                        ^
#   47|   // MR1

#   48|   

#   49|-> enum ANTLRTokenType { TER_HATES_CPP=0, ITS_TOO_COMPLICATED=9999};	    // MR1

#   50|   

#   51|   #define ANTLR_SUPPORT_CODE


Error: COMPILER_WARNING (CWE-758): [#def50]
edk2-20240813-build/edk2-b158dad150bf/BaseTools/Source/C/VfrCompile/Pccts/h/AParser.cpp: scope_hint: In member function ‘int ANTLRParser::set_deg(SetWordType*)’
edk2-20240813-build/edk2-b158dad150bf/BaseTools/Source/C/VfrCompile/Pccts/h/AParser.cpp:475:31: warning[-Wregister]: ISO C++17 does not allow ‘register’ storage class specifier
#  475 |         register SetWordType *p = a;
#      |                               ^
#  473|   	   that all word bits are used in the set

#  474|   	*/

#  475|-> 	register SetWordType *p = a;

#  476|   	register SetWordType *endp = &(a[bsetsize]);

#  477|   	register int degree = 0;


Error: COMPILER_WARNING (CWE-758): [#def51]
edk2-20240813-build/edk2-b158dad150bf/BaseTools/Source/C/VfrCompile/Pccts/h/AParser.cpp:476:31: warning[-Wregister]: ISO C++17 does not allow ‘register’ storage class specifier
#  476 |         register SetWordType *endp = &(a[bsetsize]);
#      |                               ^~~~
#  474|   	*/

#  475|   	register SetWordType *p = a;

#  476|-> 	register SetWordType *endp = &(a[bsetsize]);

#  477|   	register int degree = 0;

#  478|   


Error: COMPILER_WARNING (CWE-758): [#def52]
edk2-20240813-build/edk2-b158dad150bf/BaseTools/Source/C/VfrCompile/Pccts/h/AParser.cpp:477:22: warning[-Wregister]: ISO C++17 does not allow ‘register’ storage class specifier
#  477 |         register int degree = 0;
#      |                      ^~~~~~
#  475|   	register SetWordType *p = a;

#  476|   	register SetWordType *endp = &(a[bsetsize]);

#  477|-> 	register int degree = 0;

#  478|   

#  479|   	if ( a == NULL ) return 0;


Error: COMPILER_WARNING (CWE-758): [#def53]
edk2-20240813-build/edk2-b158dad150bf/BaseTools/Source/C/VfrCompile/Pccts/h/AParser.cpp:482:38: warning[-Wregister]: ISO C++17 does not allow ‘register’ storage class specifier
#  482 |                 register SetWordType t = *p;
#      |                                      ^
#  480|   	while ( p < endp )

#  481|   	{

#  482|-> 		register SetWordType t = *p;

#  483|   		register SetWordType *b = &(bitmask[0]);

#  484|   		do {


Error: COMPILER_WARNING (CWE-758): [#def54]
edk2-20240813-build/edk2-b158dad150bf/BaseTools/Source/C/VfrCompile/Pccts/h/AParser.cpp:483:39: warning[-Wregister]: ISO C++17 does not allow ‘register’ storage class specifier
#  483 |                 register SetWordType *b = &(bitmask[0]);
#      |                                       ^
#  481|   	{

#  482|   		register SetWordType t = *p;

#  483|-> 		register SetWordType *b = &(bitmask[0]);

#  484|   		do {

#  485|   			if (t & *b) ++degree;


Error: COMPILER_WARNING (CWE-758): [#def55]
edk2-20240813-build/edk2-b158dad150bf/BaseTools/Source/C/VfrCompile/Pccts/h/AParser.cpp: scope_hint: In member function ‘virtual void ANTLRParser::edecode(SetWordType*)’
edk2-20240813-build/edk2-b158dad150bf/BaseTools/Source/C/VfrCompile/Pccts/h/AParser.cpp:496:31: warning[-Wregister]: ISO C++17 does not allow ‘register’ storage class specifier
#  496 |         register SetWordType *p = a;
#      |                               ^
#  494|   edecode(SetWordType *a)

#  495|   {

#  496|-> 	register SetWordType *p = a;

#  497|   	register SetWordType *endp = &(p[bsetsize]);

#  498|   	register unsigned e = 0;


Error: COMPILER_WARNING (CWE-758): [#def56]
edk2-20240813-build/edk2-b158dad150bf/BaseTools/Source/C/VfrCompile/Pccts/h/AParser.cpp:497:31: warning[-Wregister]: ISO C++17 does not allow ‘register’ storage class specifier
#  497 |         register SetWordType *endp = &(p[bsetsize]);
#      |                               ^~~~
#  495|   {

#  496|   	register SetWordType *p = a;

#  497|-> 	register SetWordType *endp = &(p[bsetsize]);

#  498|   	register unsigned e = 0;

#  499|   


Error: COMPILER_WARNING (CWE-758): [#def57]
edk2-20240813-build/edk2-b158dad150bf/BaseTools/Source/C/VfrCompile/Pccts/h/AParser.cpp:498:27: warning[-Wregister]: ISO C++17 does not allow ‘register’ storage class specifier
#  498 |         register unsigned e = 0;
#      |                           ^
#  496|   	register SetWordType *p = a;

#  497|   	register SetWordType *endp = &(p[bsetsize]);

#  498|-> 	register unsigned e = 0;

#  499|   

#  500|   	if ( set_deg(a)>1 ) /* MR23 */ printMessage(stderr, " {");


Error: COMPILER_WARNING (CWE-758): [#def58]
edk2-20240813-build/edk2-b158dad150bf/BaseTools/Source/C/VfrCompile/Pccts/h/AParser.cpp:502:38: warning[-Wregister]: ISO C++17 does not allow ‘register’ storage class specifier
#  502 |                 register SetWordType t = *p;
#      |                                      ^
#  500|   	if ( set_deg(a)>1 ) /* MR23 */ printMessage(stderr, " {");

#  501|   	do {

#  502|-> 		register SetWordType t = *p;

#  503|   		register SetWordType *b = &(bitmask[0]);

#  504|   		do {


Error: COMPILER_WARNING (CWE-758): [#def59]
edk2-20240813-build/edk2-b158dad150bf/BaseTools/Source/C/VfrCompile/Pccts/h/AParser.cpp:503:39: warning[-Wregister]: ISO C++17 does not allow ‘register’ storage class specifier
#  503 |                 register SetWordType *b = &(bitmask[0]);
#      |                                       ^
#  501|   	do {

#  502|   		register SetWordType t = *p;

#  503|-> 		register SetWordType *b = &(bitmask[0]);

#  504|   		do {

#  505|   			if ( t & *b ) /* MR23 */ printMessage(stderr, " %s", token_tbl[e]);


Error: CPPCHECK_WARNING (CWE-664): [#def60]
edk2-20240813-build/edk2-b158dad150bf/BaseTools/Source/C/VfrCompile/Pccts/h/AParser.cpp:582: error[va_end_missing]: va_list 'ap' was opened but not closed by va_end().
#  580|   //

#  581|         delete [] f;                                                      // MR1

#  582|->       return;                                                           // MR1

#  583|       }

#  584|   /*  MR23 printMessage(stderr, "%s not in %dth set\n", zztokens[LA(i)], i);*/


Error: COMPILER_WARNING (CWE-563): [#def61]
edk2-20240813-build/edk2-b158dad150bf/BaseTools/Source/C/VfrCompile/Pccts/h/AParser.h:101:42: warning[-Wunused-variable]: unused variable ‘zzTracePrevRuleName’
#  101 | #define zzTRACEdata     const ANTLRChar *zzTracePrevRuleName = NULL;
#      |                                          ^~~~~~~~~~~~~~~~~~~
edk2-20240813-build/edk2-b158dad150bf/BaseTools/Source/C/VfrCompile/Pccts/h/AParser.h:358:9: note: in expansion of macro ‘zzTRACEdata’
#  358 |         zzTRACEdata \
#      |         ^~~~~~~~~~~
edk2-20240813-build/edk2-b158dad150bf/BaseTools/Source/C/VfrCompile/VfrSyntax.cpp:77:3: note: in expansion of macro ‘zzRULE’
#   77 |   zzRULE;
#      |   ^~~~~~
#   99|   						    if ( zzrv ) zzGUESS_DONE

#  100|   

#  101|-> #define zzTRACEdata     const ANTLRChar *zzTracePrevRuleName = NULL;

#  102|   

#  103|   #ifndef zzTRACEIN


Error: COMPILER_WARNING: [#def62]
edk2-20240813-build/edk2-b158dad150bf/BaseTools/Source/C/VfrCompile/Pccts/h/AParser.h:147:7: warning[-Wodr]: type ‘struct ANTLRParser’ violates the C++ One Definition Rule
#  147 | class ANTLRParser {
#      |       ^
edk2-20240813-build/edk2-b158dad150bf/BaseTools/Source/C/VfrCompile/Pccts/h/AParser.h:147:7: note: a different type is defined in another translation unit
#  147 | class ANTLRParser {
#      |       ^
edk2-20240813-build/edk2-b158dad150bf/BaseTools/Source/C/VfrCompile/Pccts/h/AParser.h:156:24: note: the first difference of corresponding definitions is field ‘eofToken’
#  156 |         ANTLRTokenType eofToken;                        // when do I stop during resynch()s
#      |                        ^
edk2-20240813-build/edk2-b158dad150bf/BaseTools/Source/C/VfrCompile/Pccts/h/AParser.h:156:24: note: a field of same name but different type is defined in another translation unit
#  156 |         ANTLRTokenType eofToken;                        // when do I stop during resynch()s
#      |                        ^
edk2-20240813-build/edk2-b158dad150bf/BaseTools/Source/C/VfrCompile/Pccts/h/AParser.cpp:49:6: note: type ‘ANTLRTokenType’ should match type ‘ANTLRTokenType’
#   49 | enum ANTLRTokenType { TER_HATES_CPP=0, ITS_TOO_COMPLICATED=9999};           // MR1
#      |      ^
#  145|    * and assigned to by antlr.

#  146|    */

#  147|-> class ANTLRParser {

#  148|   protected:

#  149|   	/* class variables */


Error: COMPILER_WARNING (CWE-563): [#def63]
edk2-20240813-build/edk2-b158dad150bf/BaseTools/Source/C/VfrCompile/VfrSyntax.cpp:25: included_from: Included from here.
edk2-20240813-build/edk2-b158dad150bf/BaseTools/Source/C/VfrCompile/VfrSyntax.cpp: scope_hint: In member function ‘UINT8 EfiVfrParser::vfrProgram()’
edk2-20240813-build/edk2-b158dad150bf/BaseTools/Source/C/VfrCompile/Pccts/h/AParser.h:356:58: warning[-Wunused-variable]: unused variable ‘zzBadText’
#  356 |                 _ANTLRTokenPtr zzBadTok=NULL; ANTLRChar *zzBadText=(ANTLRChar *)"";     \
#      |                                                          ^~~~~~~~~
edk2-20240813-build/edk2-b158dad150bf/BaseTools/Source/C/VfrCompile/VfrSyntax.cpp:77:3: note: in expansion of macro ‘zzRULE’
#   77 |   zzRULE;
#      |   ^~~~~~
#  354|   #define zzRULE \

#  355|   		SetWordType *zzMissSet=NULL; ANTLRTokenType zzMissTok=(ANTLRTokenType)0;	\

#  356|-> 		_ANTLRTokenPtr zzBadTok=NULL; ANTLRChar *zzBadText=(ANTLRChar *)"";	\

#  357|   		int zzErrk=1,zzpf=0; \

#  358|           zzTRACEdata \


Error: COMPILER_WARNING (CWE-563): [#def64]
edk2-20240813-build/edk2-b158dad150bf/BaseTools/Source/C/VfrCompile/Pccts/h/AParser.h:357:30: warning[-Wunused-variable]: unused variable ‘zzpf’
#  357 |                 int zzErrk=1,zzpf=0; \
#      |                              ^~~~
edk2-20240813-build/edk2-b158dad150bf/BaseTools/Source/C/VfrCompile/VfrSyntax.cpp:77:3: note: in expansion of macro ‘zzRULE’
#   77 |   zzRULE;
#      |   ^~~~~~
#  355|   		SetWordType *zzMissSet=NULL; ANTLRTokenType zzMissTok=(ANTLRTokenType)0;	\

#  356|   		_ANTLRTokenPtr zzBadTok=NULL; ANTLRChar *zzBadText=(ANTLRChar *)"";	\

#  357|-> 		int zzErrk=1,zzpf=0; \

#  358|           zzTRACEdata \

#  359|   		ANTLRChar *zzMissText=(ANTLRChar *)"";


Error: COMPILER_WARNING (CWE-563): [#def65]
edk2-20240813-build/edk2-b158dad150bf/BaseTools/Source/C/VfrCompile/Pccts/h/AParser.h:359:28: warning[-Wunused-variable]: unused variable ‘zzMissText’
#  359 |                 ANTLRChar *zzMissText=(ANTLRChar *)"";
#      |                            ^~~~~~~~~~
edk2-20240813-build/edk2-b158dad150bf/BaseTools/Source/C/VfrCompile/VfrSyntax.cpp:77:3: note: in expansion of macro ‘zzRULE’
#   77 |   zzRULE;
#      |   ^~~~~~
#  357|   		int zzErrk=1,zzpf=0; \

#  358|           zzTRACEdata \

#  359|-> 		ANTLRChar *zzMissText=(ANTLRChar *)"";

#  360|   

#  361|   #endif


Error: COMPILER_WARNING: [#def66]
edk2-20240813-build/edk2-b158dad150bf/BaseTools/Source/C/VfrCompile/Pccts/h/AToken.h:176:7: warning[-Wodr]: type ‘struct ANTLRCommonNoRefCountToken’ violates the C++ One Definition Rule
#  176 | class ANTLRCommonNoRefCountToken : public ANTLRAbstractToken {
#      |       ^
edk2-20240813-build/edk2-b158dad150bf/BaseTools/Source/C/VfrCompile/Pccts/h/AToken.h:176:7: note: a different type is defined in another translation unit
#  176 | class ANTLRCommonNoRefCountToken : public ANTLRAbstractToken {
#      |       ^
edk2-20240813-build/edk2-b158dad150bf/BaseTools/Source/C/VfrCompile/Pccts/h/AToken.h:178:24: note: the first difference of corresponding definitions is field ‘_type’
#  178 |         ANTLRTokenType _type;
#      |                        ^
edk2-20240813-build/edk2-b158dad150bf/BaseTools/Source/C/VfrCompile/Pccts/h/AToken.h:178:24: note: a field of same name but different type is defined in another translation unit
#  178 |         ANTLRTokenType _type;
#      |                        ^
edk2-20240813-build/edk2-b158dad150bf/BaseTools/Source/C/VfrCompile/Pccts/h/AParser.cpp:49:6: note: type ‘ANTLRTokenType’ should match type ‘ANTLRTokenType’
#   49 | enum ANTLRTokenType { TER_HATES_CPP=0, ITS_TOO_COMPLICATED=9999};           // MR1
#      |      ^
#  174|   };

#  175|   

#  176|-> class ANTLRCommonNoRefCountToken : public ANTLRAbstractToken {

#  177|   protected:

#  178|   	ANTLRTokenType _type;


Error: COMPILER_WARNING (CWE-704): [#def67]
edk2-20240813-build/edk2-b158dad150bf/BaseTools/Source/C/VfrCompile/Pccts/h/AToken.h:188:9: warning[-Wlto-type-mismatch]: type of ‘__dt_base ’ does not match original declaration
#  188 |         ~ANTLRCommonNoRefCountToken() { if (_text) delete [] _text; }  // MR9 RJV: Added Destructor to remove string
#      |         ^
edk2-20240813-build/edk2-b158dad150bf/BaseTools/Source/C/VfrCompile/Pccts/h/AToken.h:188:9: note: ‘__dt_base ’ was previously declared here
#  188 |         ~ANTLRCommonNoRefCountToken() { if (_text) delete [] _text; }  // MR9 RJV: Added Destructor to remove string
#      |         ^
edk2-20240813-build/edk2-b158dad150bf/BaseTools/Source/C/VfrCompile/Pccts/h/AToken.h:188:9: note: code may be misoptimized unless ‘-fno-strict-aliasing’ is used
#  186|   	{ setType((ANTLRTokenType)0); _line = 0; _text = NULL; setText(""); }

#  187|   

#  188|-> 	~ANTLRCommonNoRefCountToken() { if (_text) delete [] _text; }  // MR9 RJV: Added Destructor to remove string

#  189|   

#  190|   	ANTLRTokenType getType() const 	{ return _type; }


Error: COMPILER_WARNING (CWE-704): [#def68]
edk2-20240813-build/edk2-b158dad150bf/BaseTools/Source/C/VfrCompile/Pccts/h/AToken.h:188:9: warning[-Wlto-type-mismatch]: type of ‘__dt_comp ’ does not match original declaration
#  188 |         ~ANTLRCommonNoRefCountToken() { if (_text) delete [] _text; }  // MR9 RJV: Added Destructor to remove string
#      |         ^
edk2-20240813-build/edk2-b158dad150bf/BaseTools/Source/C/VfrCompile/Pccts/h/AToken.h:188:9: note: ‘__dt_comp ’ was previously declared here
#  188 |         ~ANTLRCommonNoRefCountToken() { if (_text) delete [] _text; }  // MR9 RJV: Added Destructor to remove string
#      |         ^
edk2-20240813-build/edk2-b158dad150bf/BaseTools/Source/C/VfrCompile/Pccts/h/AToken.h:188:9: note: code may be misoptimized unless ‘-fno-strict-aliasing’ is used
#  186|   	{ setType((ANTLRTokenType)0); _line = 0; _text = NULL; setText(""); }

#  187|   

#  188|-> 	~ANTLRCommonNoRefCountToken() { if (_text) delete [] _text; }  // MR9 RJV: Added Destructor to remove string

#  189|   

#  190|   	ANTLRTokenType getType() const 	{ return _type; }


Error: COMPILER_WARNING (CWE-704): [#def69]
edk2-20240813-build/edk2-b158dad150bf/BaseTools/Source/C/VfrCompile/Pccts/h/AToken.h:188:9: warning[-Wlto-type-mismatch]: type of ‘__dt_del ’ does not match original declaration
#  188 |         ~ANTLRCommonNoRefCountToken() { if (_text) delete [] _text; }  // MR9 RJV: Added Destructor to remove string
#      |         ^
edk2-20240813-build/edk2-b158dad150bf/BaseTools/Source/C/VfrCompile/Pccts/h/AToken.h:188:9: note: ‘__dt_del ’ was previously declared here
#  188 |         ~ANTLRCommonNoRefCountToken() { if (_text) delete [] _text; }  // MR9 RJV: Added Destructor to remove string
#      |         ^
edk2-20240813-build/edk2-b158dad150bf/BaseTools/Source/C/VfrCompile/Pccts/h/AToken.h:188:9: note: code may be misoptimized unless ‘-fno-strict-aliasing’ is used
#  186|   	{ setType((ANTLRTokenType)0); _line = 0; _text = NULL; setText(""); }

#  187|   

#  188|-> 	~ANTLRCommonNoRefCountToken() { if (_text) delete [] _text; }  // MR9 RJV: Added Destructor to remove string

#  189|   

#  190|   	ANTLRTokenType getType() const 	{ return _type; }


Error: COMPILER_WARNING (CWE-704): [#def70]
edk2-20240813-build/edk2-b158dad150bf/BaseTools/Source/C/VfrCompile/Pccts/h/AToken.h:190:24: warning[-Wlto-type-mismatch]: type of ‘getType’ does not match original declaration
#  190 |         ANTLRTokenType getType() const  { return _type; }
#      |                        ^
edk2-20240813-build/edk2-b158dad150bf/BaseTools/Source/C/VfrCompile/Pccts/h/AToken.h:190:24: note: return value type mismatch
#  190 |         ANTLRTokenType getType() const  { return _type; }
#      |                        ^
edk2-20240813-build/edk2-b158dad150bf/BaseTools/Source/C/VfrCompile/Pccts/h/AParser.cpp:49:6: note: type ‘ANTLRTokenType’ should match type ‘ANTLRTokenType’
#   49 | enum ANTLRTokenType { TER_HATES_CPP=0, ITS_TOO_COMPLICATED=9999};           // MR1
#      |      ^
edk2-20240813-build/edk2-b158dad150bf/BaseTools/Source/C/VfrCompile/Pccts/h/AToken.h:190:24: note: ‘getType’ was previously declared here
#  190 |         ANTLRTokenType getType() const  { return _type; }
#      |                        ^
edk2-20240813-build/edk2-b158dad150bf/BaseTools/Source/C/VfrCompile/Pccts/h/AToken.h:190:24: note: code may be misoptimized unless ‘-fno-strict-aliasing’ is used
#  188|   	~ANTLRCommonNoRefCountToken() { if (_text) delete [] _text; }  // MR9 RJV: Added Destructor to remove string

#  189|   

#  190|-> 	ANTLRTokenType getType() const 	{ return _type; }

#  191|   	void setType(ANTLRTokenType t)	{ _type = t; }

#  192|   	virtual int getLine() const		{ return _line; }


Error: COMPILER_WARNING (CWE-704): [#def71]
edk2-20240813-build/edk2-b158dad150bf/BaseTools/Source/C/VfrCompile/Pccts/h/AToken.h:192:21: warning[-Wlto-type-mismatch]: type of ‘getLine’ does not match original declaration
#  192 |         virtual int getLine() const             { return _line; }
#      |                     ^
edk2-20240813-build/edk2-b158dad150bf/BaseTools/Source/C/VfrCompile/Pccts/h/AToken.h:192:21: note: ‘getLine’ was previously declared here
#  192 |         virtual int getLine() const             { return _line; }
#      |                     ^
edk2-20240813-build/edk2-b158dad150bf/BaseTools/Source/C/VfrCompile/Pccts/h/AToken.h:192:21: note: code may be misoptimized unless ‘-fno-strict-aliasing’ is used
#  190|   	ANTLRTokenType getType() const 	{ return _type; }

#  191|   	void setType(ANTLRTokenType t)	{ _type = t; }

#  192|-> 	virtual int getLine() const		{ return _line; }

#  193|   	void setLine(int line)	    	{ _line = line; }

#  194|   	ANTLRChar *getText() const   	{ return _text; }


Error: COMPILER_WARNING (CWE-704): [#def72]
edk2-20240813-build/edk2-b158dad150bf/BaseTools/Source/C/VfrCompile/Pccts/h/AToken.h:193:14: warning[-Wlto-type-mismatch]: type of ‘setLine’ does not match original declaration
#  193 |         void setLine(int line)          { _line = line; }
#      |              ^
edk2-20240813-build/edk2-b158dad150bf/BaseTools/Source/C/VfrCompile/Pccts/h/AToken.h:193:14: note: ‘setLine’ was previously declared here
#  193 |         void setLine(int line)          { _line = line; }
#      |              ^
edk2-20240813-build/edk2-b158dad150bf/BaseTools/Source/C/VfrCompile/Pccts/h/AToken.h:193:14: note: code may be misoptimized unless ‘-fno-strict-aliasing’ is used
#  191|   	void setType(ANTLRTokenType t)	{ _type = t; }

#  192|   	virtual int getLine() const		{ return _line; }

#  193|-> 	void setLine(int line)	    	{ _line = line; }

#  194|   	ANTLRChar *getText() const   	{ return _text; }

#  195|       int getLength() const           { return strlen(getText()); }       // MR11


Error: COMPILER_WARNING (CWE-704): [#def73]
edk2-20240813-build/edk2-b158dad150bf/BaseTools/Source/C/VfrCompile/Pccts/h/AToken.h:194:20: warning[-Wlto-type-mismatch]: type of ‘getText’ does not match original declaration
#  194 |         ANTLRChar *getText() const      { return _text; }
#      |                    ^
edk2-20240813-build/edk2-b158dad150bf/BaseTools/Source/C/VfrCompile/Pccts/h/AToken.h:194:20: note: ‘getText’ was previously declared here
#  194 |         ANTLRChar *getText() const      { return _text; }
#      |                    ^
edk2-20240813-build/edk2-b158dad150bf/BaseTools/Source/C/VfrCompile/Pccts/h/AToken.h:194:20: note: code may be misoptimized unless ‘-fno-strict-aliasing’ is used
#  192|   	virtual int getLine() const		{ return _line; }

#  193|   	void setLine(int line)	    	{ _line = line; }

#  194|-> 	ANTLRChar *getText() const   	{ return _text; }

#  195|       int getLength() const           { return strlen(getText()); }       // MR11

#  196|   


Error: COMPILER_WARNING (CWE-704): [#def74]
edk2-20240813-build/edk2-b158dad150bf/BaseTools/Source/C/VfrCompile/Pccts/h/AToken.h:199:14: warning[-Wlto-type-mismatch]: type of ‘setText’ does not match original declaration
#  199 |         void setText(const ANTLRChar *s)
#      |              ^
edk2-20240813-build/edk2-b158dad150bf/BaseTools/Source/C/VfrCompile/Pccts/h/AToken.h:199:14: note: ‘setText’ was previously declared here
#  199 |         void setText(const ANTLRChar *s)
#      |              ^
edk2-20240813-build/edk2-b158dad150bf/BaseTools/Source/C/VfrCompile/Pccts/h/AToken.h:199:14: note: code may be misoptimized unless ‘-fno-strict-aliasing’ is used
#  197|   // MR9 RJV: Added code for variable length strings to setText()

#  198|   

#  199|-> 	void setText(const ANTLRChar *s)

#  200|   	{	if (s != _text) {

#  201|             if (_text) delete [] _text;


Error: COMPILER_WARNING (CWE-704): [#def75]
edk2-20240813-build/edk2-b158dad150bf/BaseTools/Source/C/VfrCompile/Pccts/h/AToken.h:235:40: warning[-Wlto-type-mismatch]: type of ‘operator=’ does not match original declaration
#  235 |    virtual ANTLRCommonNoRefCountToken& operator =(const ANTLRCommonNoRefCountToken& rhs) {
#      |                                        ^
edk2-20240813-build/edk2-b158dad150bf/BaseTools/Source/C/VfrCompile/Pccts/h/AToken.h:235:40: note: ‘operator=’ was previously declared here
#  235 |    virtual ANTLRCommonNoRefCountToken& operator =(const ANTLRCommonNoRefCountToken& rhs) {
#      |                                        ^
edk2-20240813-build/edk2-b158dad150bf/BaseTools/Source/C/VfrCompile/Pccts/h/AToken.h:235:40: note: code may be misoptimized unless ‘-fno-strict-aliasing’ is used
#  233|   // MR9 THM operator =() required when heap allocated string is used with copy semantics

#  234|   

#  235|->    virtual ANTLRCommonNoRefCountToken& operator =(const ANTLRCommonNoRefCountToken& rhs) {

#  236|   

#  237|   //////  MR15 WatCom can't hack use of operator =()


Error: COMPILER_WARNING: [#def76]
edk2-20240813-build/edk2-b158dad150bf/BaseTools/Source/C/VfrCompile/Pccts/h/AToken.h:249:7: warning[-Wodr]: type ‘struct ANTLRCommonToken’ violates the C++ One Definition Rule
#  249 | class ANTLRCommonToken : public ANTLRRefCountToken {
#      |       ^
edk2-20240813-build/edk2-b158dad150bf/BaseTools/Source/C/VfrCompile/Pccts/h/AToken.h:249:7: note: a different type is defined in another translation unit
#  249 | class ANTLRCommonToken : public ANTLRRefCountToken {
#      |       ^
edk2-20240813-build/edk2-b158dad150bf/BaseTools/Source/C/VfrCompile/Pccts/h/AToken.h:251:30: note: the first difference of corresponding definitions is field ‘_type’
#  251 |         ANTLRTokenType       _type;
#      |                              ^
edk2-20240813-build/edk2-b158dad150bf/BaseTools/Source/C/VfrCompile/Pccts/h/AToken.h:251:30: note: a field of same name but different type is defined in another translation unit
#  251 |         ANTLRTokenType       _type;
#      |                              ^
edk2-20240813-build/edk2-b158dad150bf/BaseTools/Source/C/VfrCompile/Pccts/h/AParser.cpp:49:6: note: type ‘ANTLRTokenType’ should match type ‘ANTLRTokenType’
#   49 | enum ANTLRTokenType { TER_HATES_CPP=0, ITS_TOO_COMPLICATED=9999};           // MR1
#      |      ^
#  247|   };

#  248|   

#  249|-> class ANTLRCommonToken : public ANTLRRefCountToken {

#  250|   protected:

#  251|   	ANTLRTokenType       _type;


Error: COMPILER_WARNING (CWE-704): [#def77]
edk2-20240813-build/edk2-b158dad150bf/BaseTools/Source/C/VfrCompile/Pccts/h/AToken.h:261:17: warning[-Wlto-type-mismatch]: type of ‘__dt_base ’ does not match original declaration
#  261 |         virtual ~ANTLRCommonToken() { if (_text) delete [] _text; } // MR9 RJV: Added Destructor to remove string
#      |                 ^
edk2-20240813-build/edk2-b158dad150bf/BaseTools/Source/C/VfrCompile/Pccts/h/AToken.h:261:17: note: ‘__dt_base ’ was previously declared here
#  261 |         virtual ~ANTLRCommonToken() { if (_text) delete [] _text; } // MR9 RJV: Added Destructor to remove string
#      |                 ^
edk2-20240813-build/edk2-b158dad150bf/BaseTools/Source/C/VfrCompile/Pccts/h/AToken.h:261:17: note: code may be misoptimized unless ‘-fno-strict-aliasing’ is used
#  259|   		{ setType((ANTLRTokenType)0); _line = 0; _text = NULL; setText(""); }   // MR9

#  260|   

#  261|-> 	virtual ~ANTLRCommonToken() { if (_text) delete [] _text; } // MR9 RJV: Added Destructor to remove string

#  262|   

#  263|   	ANTLRTokenType getType() const 	{ return _type; }


Error: COMPILER_WARNING (CWE-704): [#def78]
edk2-20240813-build/edk2-b158dad150bf/BaseTools/Source/C/VfrCompile/Pccts/h/AToken.h:261:17: warning[-Wlto-type-mismatch]: type of ‘__dt_comp ’ does not match original declaration
#  261 |         virtual ~ANTLRCommonToken() { if (_text) delete [] _text; } // MR9 RJV: Added Destructor to remove string
#      |                 ^
edk2-20240813-build/edk2-b158dad150bf/BaseTools/Source/C/VfrCompile/Pccts/h/AToken.h:261:17: note: ‘__dt_comp ’ was previously declared here
#  261 |         virtual ~ANTLRCommonToken() { if (_text) delete [] _text; } // MR9 RJV: Added Destructor to remove string
#      |                 ^
edk2-20240813-build/edk2-b158dad150bf/BaseTools/Source/C/VfrCompile/Pccts/h/AToken.h:261:17: note: code may be misoptimized unless ‘-fno-strict-aliasing’ is used
#  259|   		{ setType((ANTLRTokenType)0); _line = 0; _text = NULL; setText(""); }   // MR9

#  260|   

#  261|-> 	virtual ~ANTLRCommonToken() { if (_text) delete [] _text; } // MR9 RJV: Added Destructor to remove string

#  262|   

#  263|   	ANTLRTokenType getType() const 	{ return _type; }


Error: COMPILER_WARNING (CWE-704): [#def79]
edk2-20240813-build/edk2-b158dad150bf/BaseTools/Source/C/VfrCompile/Pccts/h/AToken.h:261:17: warning[-Wlto-type-mismatch]: type of ‘__dt_del ’ does not match original declaration
#  261 |         virtual ~ANTLRCommonToken() { if (_text) delete [] _text; } // MR9 RJV: Added Destructor to remove string
#      |                 ^
edk2-20240813-build/edk2-b158dad150bf/BaseTools/Source/C/VfrCompile/Pccts/h/AToken.h:261:17: note: ‘__dt_del ’ was previously declared here
#  261 |         virtual ~ANTLRCommonToken() { if (_text) delete [] _text; } // MR9 RJV: Added Destructor to remove string
#      |                 ^
edk2-20240813-build/edk2-b158dad150bf/BaseTools/Source/C/VfrCompile/Pccts/h/AToken.h:261:17: note: code may be misoptimized unless ‘-fno-strict-aliasing’ is used
#  259|   		{ setType((ANTLRTokenType)0); _line = 0; _text = NULL; setText(""); }   // MR9

#  260|   

#  261|-> 	virtual ~ANTLRCommonToken() { if (_text) delete [] _text; } // MR9 RJV: Added Destructor to remove string

#  262|   

#  263|   	ANTLRTokenType getType() const 	{ return _type; }


Error: COMPILER_WARNING (CWE-704): [#def80]
edk2-20240813-build/edk2-b158dad150bf/BaseTools/Source/C/VfrCompile/Pccts/h/AToken.h:263:24: warning[-Wlto-type-mismatch]: type of ‘getType’ does not match original declaration
#  263 |         ANTLRTokenType getType() const  { return _type; }
#      |                        ^
edk2-20240813-build/edk2-b158dad150bf/BaseTools/Source/C/VfrCompile/Pccts/h/AToken.h:263:24: note: return value type mismatch
#  263 |         ANTLRTokenType getType() const  { return _type; }
#      |                        ^
edk2-20240813-build/edk2-b158dad150bf/BaseTools/Source/C/VfrCompile/Pccts/h/AParser.cpp:49:6: note: type ‘ANTLRTokenType’ should match type ‘ANTLRTokenType’
#   49 | enum ANTLRTokenType { TER_HATES_CPP=0, ITS_TOO_COMPLICATED=9999};           // MR1
#      |      ^
edk2-20240813-build/edk2-b158dad150bf/BaseTools/Source/C/VfrCompile/Pccts/h/AToken.h:263:24: note: ‘getType’ was previously declared here
#  263 |         ANTLRTokenType getType() const  { return _type; }
#      |                        ^
edk2-20240813-build/edk2-b158dad150bf/BaseTools/Source/C/VfrCompile/Pccts/h/AToken.h:263:24: note: code may be misoptimized unless ‘-fno-strict-aliasing’ is used
#  261|   	virtual ~ANTLRCommonToken() { if (_text) delete [] _text; } // MR9 RJV: Added Destructor to remove string

#  262|   

#  263|-> 	ANTLRTokenType getType() const 	{ return _type; }

#  264|   	void setType(ANTLRTokenType t)	{ _type = t; }

#  265|   	virtual int getLine() const		{ return _line; }


Error: COMPILER_WARNING (CWE-704): [#def81]
edk2-20240813-build/edk2-b158dad150bf/BaseTools/Source/C/VfrCompile/Pccts/h/AToken.h:265:21: warning[-Wlto-type-mismatch]: type of ‘getLine’ does not match original declaration
#  265 |         virtual int getLine() const             { return _line; }
#      |                     ^
edk2-20240813-build/edk2-b158dad150bf/BaseTools/Source/C/VfrCompile/Pccts/h/AToken.h:265:21: note: ‘getLine’ was previously declared here
#  265 |         virtual int getLine() const             { return _line; }
#      |                     ^
edk2-20240813-build/edk2-b158dad150bf/BaseTools/Source/C/VfrCompile/Pccts/h/AToken.h:265:21: note: code may be misoptimized unless ‘-fno-strict-aliasing’ is used
#  263|   	ANTLRTokenType getType() const 	{ return _type; }

#  264|   	void setType(ANTLRTokenType t)	{ _type = t; }

#  265|-> 	virtual int getLine() const		{ return _line; }

#  266|   	void setLine(int line)	    	{ _line = line; }

#  267|   	ANTLRChar *getText() const		{ return _text; }


Error: COMPILER_WARNING (CWE-704): [#def82]
edk2-20240813-build/edk2-b158dad150bf/BaseTools/Source/C/VfrCompile/Pccts/h/AToken.h:266:14: warning[-Wlto-type-mismatch]: type of ‘setLine’ does not match original declaration
#  266 |         void setLine(int line)          { _line = line; }
#      |              ^
edk2-20240813-build/edk2-b158dad150bf/BaseTools/Source/C/VfrCompile/Pccts/h/AToken.h:266:14: note: ‘setLine’ was previously declared here
#  266 |         void setLine(int line)          { _line = line; }
#      |              ^
edk2-20240813-build/edk2-b158dad150bf/BaseTools/Source/C/VfrCompile/Pccts/h/AToken.h:266:14: note: code may be misoptimized unless ‘-fno-strict-aliasing’ is used
#  264|   	void setType(ANTLRTokenType t)	{ _type = t; }

#  265|   	virtual int getLine() const		{ return _line; }

#  266|-> 	void setLine(int line)	    	{ _line = line; }

#  267|   	ANTLRChar *getText() const		{ return _text; }

#  268|       int getLength() const           { return strlen(getText()); }       // MR11


Error: COMPILER_WARNING (CWE-704): [#def83]
edk2-20240813-build/edk2-b158dad150bf/BaseTools/Source/C/VfrCompile/Pccts/h/AToken.h:267:20: warning[-Wlto-type-mismatch]: type of ‘getText’ does not match original declaration
#  267 |         ANTLRChar *getText() const              { return _text; }
#      |                    ^
edk2-20240813-build/edk2-b158dad150bf/BaseTools/Source/C/VfrCompile/Pccts/h/AToken.h:267:20: note: ‘getText’ was previously declared here
#  267 |         ANTLRChar *getText() const              { return _text; }
#      |                    ^
edk2-20240813-build/edk2-b158dad150bf/BaseTools/Source/C/VfrCompile/Pccts/h/AToken.h:267:20: note: code may be misoptimized unless ‘-fno-strict-aliasing’ is used
#  265|   	virtual int getLine() const		{ return _line; }

#  266|   	void setLine(int line)	    	{ _line = line; }

#  267|-> 	ANTLRChar *getText() const		{ return _text; }

#  268|       int getLength() const           { return strlen(getText()); }       // MR11

#  269|   


Error: COMPILER_WARNING (CWE-704): [#def84]
edk2-20240813-build/edk2-b158dad150bf/BaseTools/Source/C/VfrCompile/Pccts/h/AToken.h:272:14: warning[-Wlto-type-mismatch]: type of ‘setText’ does not match original declaration
#  272 |         void setText(const ANTLRChar *s)
#      |              ^
edk2-20240813-build/edk2-b158dad150bf/BaseTools/Source/C/VfrCompile/Pccts/h/AToken.h:272:14: note: ‘setText’ was previously declared here
#  272 |         void setText(const ANTLRChar *s)
#      |              ^
edk2-20240813-build/edk2-b158dad150bf/BaseTools/Source/C/VfrCompile/Pccts/h/AToken.h:272:14: note: code may be misoptimized unless ‘-fno-strict-aliasing’ is used
#  270|   // MR9 RJV: Added code for variable length strings to setText()

#  271|   

#  272|-> 	void setText(const ANTLRChar *s)

#  273|   	{	if (s != _text) {

#  274|             if (_text) delete [] _text;


Error: COMPILER_WARNING (CWE-704): [#def85]
edk2-20240813-build/edk2-b158dad150bf/BaseTools/Source/C/VfrCompile/Pccts/h/AToken.h:308:30: warning[-Wlto-type-mismatch]: type of ‘operator=’ does not match original declaration
#  308 |    virtual ANTLRCommonToken& operator =(const ANTLRCommonToken& rhs) {
#      |                              ^
edk2-20240813-build/edk2-b158dad150bf/BaseTools/Source/C/VfrCompile/Pccts/h/AToken.h:308:30: note: ‘operator=’ was previously declared here
#  308 |    virtual ANTLRCommonToken& operator =(const ANTLRCommonToken& rhs) {
#      |                              ^
edk2-20240813-build/edk2-b158dad150bf/BaseTools/Source/C/VfrCompile/Pccts/h/AToken.h:308:30: note: code may be misoptimized unless ‘-fno-strict-aliasing’ is used
#  306|   // MR9 THM operator =() required when heap allocated string is used with copy semantics

#  307|   

#  308|->    virtual ANTLRCommonToken& operator =(const ANTLRCommonToken& rhs) {

#  309|   

#  310|   //////  MR15 WatCom can't hack use of operator =()


Error: COMPILER_WARNING (CWE-758): [#def86]
edk2-20240813-build/edk2-b158dad150bf/BaseTools/Source/C/VfrCompile/VfrLexer.cpp:22124: included_from: Included from here.
edk2-20240813-build/edk2-b158dad150bf/BaseTools/Source/C/VfrCompile/Pccts/h/DLexer.h: scope_hint: In member function ‘virtual ANTLRTokenType VfrLexer::nextTokenType()’
edk2-20240813-build/edk2-b158dad150bf/BaseTools/Source/C/VfrCompile/Pccts/h/DLexer.h:68:22: warning[-Wregister]: ISO C++17 does not allow ‘register’ storage class specifier
#   68 |         register int state, newstate;
#      |                      ^~~~~
#   66|   nextTokenType(void)

#   67|   {

#   68|-> 	register int state, newstate;

#   69|   	/* last space reserved for the null char */

#   70|   	register DLGChar *lastpos;


Error: COMPILER_WARNING (CWE-758): [#def87]
edk2-20240813-build/edk2-b158dad150bf/BaseTools/Source/C/VfrCompile/Pccts/h/DLexer.h:68:29: warning[-Wregister]: ISO C++17 does not allow ‘register’ storage class specifier
#   68 |         register int state, newstate;
#      |                             ^~~~~~~~
#   66|   nextTokenType(void)

#   67|   {

#   68|-> 	register int state, newstate;

#   69|   	/* last space reserved for the null char */

#   70|   	register DLGChar *lastpos;


Error: COMPILER_WARNING (CWE-758): [#def88]
edk2-20240813-build/edk2-b158dad150bf/BaseTools/Source/C/VfrCompile/Pccts/h/DLexer.h:70:27: warning[-Wregister]: ISO C++17 does not allow ‘register’ storage class specifier
#   70 |         register DLGChar *lastpos;
#      |                           ^~~~~~~
#   68|   	register int state, newstate;

#   69|   	/* last space reserved for the null char */

#   70|-> 	register DLGChar *lastpos;

#   71|   	ANTLRTokenType tk;

#   72|   


Error: COMPILER_WARNING (CWE-195): [#def89]
edk2-20240813-build/edk2-b158dad150bf/BaseTools/Source/C/VfrCompile/Pccts/h/DLexer.h:33: included_from: Included from here.
edk2-20240813-build/edk2-b158dad150bf/BaseTools/Source/C/VfrCompile/Pccts/h/DLexer.h:119:26: warning[-Wsign-compare]: comparison of integer expressions of different signedness: ‘int’ and ‘long unsigned int’
#  119 |             assert(state <= sizeof(dfa)/sizeof(dfa[0]));
#      |                    ~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#  117|   		while (ZZNEWSTATE != DfaStates) {

#  118|   			state = newstate;

#  119|->             assert(state <= sizeof(dfa)/sizeof(dfa[0]));

#  120|   			ZZCOPY;

#  121|   			ZZGETC;


Error: COMPILER_WARNING (CWE-758): [#def90]
edk2-20240813-build/edk2-b158dad150bf/BaseTools/Source/C/VfrCompile/Pccts/h/DLexerBase.cpp: scope_hint: In member function ‘void DLGLexerBase::replstr(const DLGChar*)’
edk2-20240813-build/edk2-b158dad150bf/BaseTools/Source/C/VfrCompile/Pccts/h/DLexerBase.cpp:196:27: warning[-Wregister]: ISO C++17 does not allow ‘register’ storage class specifier
#  196 |         register DLGChar *l= &_lextext[_bufsize -1];
#      |                           ^
#  194|   replstr(const DLGChar *s) /* MR20 const */

#  195|   {

#  196|-> 	register DLGChar *l= &_lextext[_bufsize -1];

#  197|   

#  198|   	nextpos = _begexpr;


Error: CPPCHECK_WARNING (CWE-664): [#def91]
edk2-20240813-build/edk2-b158dad150bf/BaseTools/Source/C/VfrCompile/Pccts/h/err.h:214: error[va_end_missing]: va_list 'ap' was opened but not closed by va_end().
#  212|   		*bad_text = LATEXT(1);

#  213|   		*err_k = k;

#  214|-> 		return;

#  215|   	}

#  216|   /*	fprintf(stderr, "%s not in %dth set\n", zztokens[LA(i)], i);*/


Error: GCC_ANALYZER_WARNING (CWE-476): [#def92]
edk2-20240813-build/edk2-b158dad150bf/BaseTools/Source/C/VfrCompile/Pccts/support/set/set.c: scope_hint: In function ‘set_val’
edk2-20240813-build/edk2-b158dad150bf/BaseTools/Source/C/VfrCompile/Pccts/support/set/set.c:563:20: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘p’
edk2-20240813-build/edk2-b158dad150bf/BaseTools/Source/C/VfrCompile/Pccts/support/set/set.c:67: included_from: Included from here.
edk2-20240813-build/edk2-b158dad150bf/BaseTools/Source/C/VfrCompile/Pccts/support/set/set.c:557:9: note: in expansion of macro ‘set_new’
edk2-20240813-build/edk2-b158dad150bf/BaseTools/Source/C/VfrCompile/Pccts/support/set/set.c:557:9: note: in expansion of macro ‘set_new’
edk2-20240813-build/edk2-b158dad150bf/BaseTools/Source/C/VfrCompile/Pccts/support/set/set.c:557:9: note: in expansion of macro ‘set_new’
edk2-20240813-build/edk2-b158dad150bf/BaseTools/Source/C/VfrCompile/Pccts/support/set/set.h:58:74: note: in definition of macro ‘set_new’
#  561|   		register unsigned *b = &(bitmask[0]);

#  562|   		/* Start with a word with no bits on */

#  563|-> 		*p = 0;

#  564|   		do {

#  565|   			if (*s) {


Error: COMPILER_WARNING (CWE-563): [#def93]
edk2-20240813-build/edk2-b158dad150bf/BaseTools/Source/C/VfrCompile/VfrCompiler.cpp: scope_hint: In member function ‘void CVfrCompiler::AdjustBin()’
edk2-20240813-build/edk2-b158dad150bf/BaseTools/Source/C/VfrCompile/VfrCompiler.cpp:719:23: warning[-Wunused-variable]: unused variable ‘Status’
#  719 |   EFI_VFR_RETURN_CODE Status;
#      |                       ^~~~~~
#  717|     )

#  718|   {

#  719|->   EFI_VFR_RETURN_CODE Status;

#  720|   

#  721|     if (!IS_RUN_STATUS(STATUS_COMPILEED)) {


Error: COMPILER_WARNING (CWE-457): [#def94]
edk2-20240813-build/edk2-b158dad150bf/BaseTools/Source/C/VfrCompile/VfrFormPkg.cpp: scope_hint: In member function ‘CIfrRecordInfoDB::IfrAdjustDynamicOpcodeInRecords(unsigned char)’
edk2-20240813-build/edk2-b158dad150bf/BaseTools/Source/C/VfrCompile/VfrFormPkg.cpp:1344:57: warning[-Wmaybe-uninitialized]: ‘pNodeBeforeAdjust’ may be used uninitialized
# 1344 |   if (pNodeBeforeDynamic == NULL || pAdjustNode == NULL || pNodeBeforeAdjust == NULL) {
#      |                                                         ^
edk2-20240813-build/edk2-b158dad150bf/BaseTools/Source/C/VfrCompile/VfrFormPkg.cpp:1316:37: note: ‘pNodeBeforeAdjust’ was declared here
# 1316 |   SIfrRecord         *pAdjustNode, *pNodeBeforeAdjust;
#      |                                     ^~~~~~~~~~~~~~~~~
# 1342|     // Check the nodes whether exist.

# 1343|     //

# 1344|->   if (pNodeBeforeDynamic == NULL || pAdjustNode == NULL || pNodeBeforeAdjust == NULL) {

# 1345|       return FALSE;

# 1346|     }


Error: COMPILER_WARNING (CWE-563): [#def95]
edk2-20240813-build/edk2-b158dad150bf/BaseTools/Source/C/VfrCompile/VfrFormPkg.h:650:27: warning[-Wunused-variable]: ‘gIsOrderedList’ defined but not used
#  650 | static BOOLEAN            gIsOrderedList = FALSE;
#      |                           ^~~~~~~~~~~~~~
#  648|   static CIfrQuestionHeader *gCurrentQuestion  = NULL;

#  649|   static CIfrMinMaxStepData *gCurrentMinMaxData = NULL;

#  650|-> static BOOLEAN            gIsOrderedList = FALSE;

#  651|   static BOOLEAN            gIsStringOp = FALSE;

#  652|   


Error: COMPILER_WARNING (CWE-563): [#def96]
edk2-20240813-build/edk2-b158dad150bf/BaseTools/Source/C/VfrCompile/EfiVfrParser.h:25: included_from: Included from here.
edk2-20240813-build/edk2-b158dad150bf/BaseTools/Source/C/VfrCompile/EfiVfrParser.cpp:18: included_from: Included from here.
edk2-20240813-build/edk2-b158dad150bf/BaseTools/Source/C/VfrCompile/VfrFormPkg.h:651:27: warning[-Wunused-variable]: ‘gIsStringOp’ defined but not used
#  651 | static BOOLEAN            gIsStringOp = FALSE;
#      |                           ^~~~~~~~~~~
#  649|   static CIfrMinMaxStepData *gCurrentMinMaxData = NULL;

#  650|   static BOOLEAN            gIsOrderedList = FALSE;

#  651|-> static BOOLEAN            gIsStringOp = FALSE;

#  652|   

#  653|   /*


Error: COMPILER_WARNING (CWE-1164): [#def97]
edk2-20240813-build/edk2-b158dad150bf/BaseTools/Source/C/VfrCompile/VfrSyntax.cpp:106:1: warning[-Wunused-label]: label ‘fail’ defined but not used
#  106 | fail:
#      | ^~~~
#  104|     _retv = mParserStatus;
#  105|     return _retv;
#  106|-> fail:
#  107|     syn(zzBadTok, (ANTLRChar *)"", zzMissSet, zzMissTok, zzErrk);
#  108|     resynch(setwd1, 0x80);

Error: COMPILER_WARNING (CWE-1164): [#def98]
edk2-20240813-build/edk2-b158dad150bf/BaseTools/Source/C/VfrCompile/VfrSyntax.cpp:473:1: warning[-Wunused-label]: label ‘fail’ defined but not used
#  473 | fail:
#      | ^~~~
#  471|     }
#  472|     return;
#  473|-> fail:
#  474|     syn(zzBadTok, (ANTLRChar *)"", zzMissSet, zzMissTok, zzErrk);
#  475|     resynch(setwd5, 0x2);

Error: COMPILER_WARNING (CWE-1164): [#def99]
edk2-20240813-build/edk2-b158dad150bf/BaseTools/Source/C/VfrCompile/VfrSyntax.cpp:1432:1: warning[-Wunused-label]: label ‘fail’ defined but not used
# 1432 | fail:
#      | ^~~~
# 1430|     }
# 1431|     return;
# 1432|-> fail:
# 1433|     syn(zzBadTok, (ANTLRChar *)"", zzMissSet, zzMissTok, zzErrk);
# 1434|     resynch(setwd7, 0x80);

Error: COMPILER_WARNING (CWE-457): [#def100]
edk2-20240813-build/edk2-b158dad150bf/BaseTools/Source/C/VfrCompile/VfrSyntax.cpp:1948:48: warning[-Wmaybe-uninitialized]: ‘Offset’ may be used uninitialized
# 1948 |               Value = *(UINT64*) (ByteOffset + Offset);
#      |                                                ^~~~~~
edk2-20240813-build/edk2-b158dad150bf/BaseTools/Source/C/VfrCompile/VfrSyntax.cpp:1795:12: note: ‘Offset’ was declared here
# 1795 |   UINT16   Offset;
#      |            ^~~~~~
# 1946|                 // Set the value to the bit fileds.

# 1947|                 //

# 1948|->               Value = *(UINT64*) (ByteOffset + Offset);

# 1949|                 Data_U64 <<= PreBits;

# 1950|                 Value = (Value & (~Mask)) | Data_U64;


Error: COMPILER_WARNING (CWE-457): [#def101]
edk2-20240813-build/edk2-b158dad150bf/BaseTools/Source/C/VfrCompile/VfrSyntax.cpp:1949:28: warning[-Wmaybe-uninitialized]: ‘PreBits’ may be used uninitialized
# 1949 |               Data_U64 <<= PreBits;
#      |                            ^~~~~~~
edk2-20240813-build/edk2-b158dad150bf/BaseTools/Source/C/VfrCompile/VfrSyntax.cpp:1796:12: note: ‘PreBits’ was declared here
# 1796 |   UINT8    PreBits;
#      |            ^~~~~~~
# 1947|                 //

# 1948|                 Value = *(UINT64*) (ByteOffset + Offset);

# 1949|->               Data_U64 <<= PreBits;

# 1950|                 Value = (Value & (~Mask)) | Data_U64;

# 1951|                 memcpy (ByteOffset + Offset, &Value, sizeof (UINT64));


Error: COMPILER_WARNING (CWE-457): [#def102]
edk2-20240813-build/edk2-b158dad150bf/BaseTools/Source/C/VfrCompile/VfrSyntax.cpp: scope_hint: In member function ‘EfiVfrParser::vfrExtensionData(unsigned char*, unsigned int, char*, unsigned int, unsigned char, unsigned int)’
edk2-20240813-build/edk2-b158dad150bf/BaseTools/Source/C/VfrCompile/VfrSyntax.cpp:1950:33: warning[-Wmaybe-uninitialized]: ‘Mask’ may be used uninitialized
# 1950 |               Value = (Value & (~Mask)) | Data_U64;
#      |                                ~^~~~~~
edk2-20240813-build/edk2-b158dad150bf/BaseTools/Source/C/VfrCompile/VfrSyntax.cpp:1794:12: note: ‘Mask’ was declared here
# 1794 |   UINT64   Mask;
#      |            ^~~~
# 1948|                 Value = *(UINT64*) (ByteOffset + Offset);

# 1949|                 Data_U64 <<= PreBits;

# 1950|->               Value = (Value & (~Mask)) | Data_U64;

# 1951|                 memcpy (ByteOffset + Offset, &Value, sizeof (UINT64));

# 1952|               } else {


Error: COMPILER_WARNING (CWE-563): [#def103]
edk2-20240813-build/edk2-b158dad150bf/BaseTools/Source/C/VfrCompile/VfrSyntax.cpp: scope_hint: In member function ‘void EfiVfrParser::vfrStatementVarStoreNameValue()’
edk2-20240813-build/edk2-b158dad150bf/BaseTools/Source/C/VfrCompile/VfrSyntax.cpp:2516:9: warning[-Wunused-variable]: unused variable ‘zzcnt’
# 2516 |     int zzcnt=1;
#      |         ^~~~~
# 2514|     }
# 2515|     {
# 2516|->     int zzcnt=1;
# 2517|       do {
# 2518|         zzmatch(Name); consume();

Error: COMPILER_WARNING (CWE-1164): [#def104]
edk2-20240813-build/edk2-b158dad150bf/BaseTools/Source/C/VfrCompile/VfrSyntax.cpp:2914:1: warning[-Wunused-label]: label ‘fail’ defined but not used
# 2914 | fail:
#      | ^~~~
# 2912|     vfrStatementHeader( & QHObj );
# 2913|     return;
# 2914|-> fail:
# 2915|     syn(zzBadTok, (ANTLRChar *)"", zzMissSet, zzMissTok, zzErrk);
# 2916|     resynch(setwd11, 0x80);

Error: COMPILER_WARNING (CWE-563): [#def105]
edk2-20240813-build/edk2-b158dad150bf/BaseTools/Source/C/VfrCompile/VfrSyntax.cpp:3014:25: warning[-Wunused-variable]: unused variable ‘LineNo’
# 3014 |   UINT32                LineNo;
#      |                         ^~~~~~
# 3012|     

# 3013|     UINT32                Idx;

# 3014|->   UINT32                LineNo;

# 3015|     EFI_VFR_VARSTORE_TYPE VarStoreType = EFI_VFR_VARSTORE_INVALID;

# 3016|     CHAR8                 *VarIdStr    = NULL;


Error: COMPILER_WARNING (CWE-1164): [#def106]
edk2-20240813-build/edk2-b158dad150bf/BaseTools/Source/C/VfrCompile/VfrSyntax.cpp:4160:1: warning[-Wunused-label]: label ‘fail’ defined but not used
# 4160 | fail:
#      | ^~~~
# 4158|     vfrStatementSuppressIfStatNew();
# 4159|     return;
# 4160|-> fail:
# 4161|     syn(zzBadTok, (ANTLRChar *)"", zzMissSet, zzMissTok, zzErrk);
# 4162|     resynch(setwd16, 0x1);

Error: COMPILER_WARNING (CWE-1164): [#def107]
edk2-20240813-build/edk2-b158dad150bf/BaseTools/Source/C/VfrCompile/VfrSyntax.cpp:4171:1: warning[-Wunused-label]: label ‘fail’ defined but not used
# 4171 | fail:
#      | ^~~~
# 4169|     vfrStatementGrayOutIfStatNew();
# 4170|     return;
# 4171|-> fail:
# 4172|     syn(zzBadTok, (ANTLRChar *)"", zzMissSet, zzMissTok, zzErrk);
# 4173|     resynch(setwd16, 0x2);

Error: COMPILER_WARNING (CWE-195): [#def108]
edk2-20240813-build/edk2-b158dad150bf/BaseTools/Source/C/VfrCompile/VfrSyntax.cpp: scope_hint: In member function ‘void EfiVfrParser::vfrSetMinMaxStep(CIfrMinMaxStepData&)’
edk2-20240813-build/edk2-b158dad150bf/BaseTools/Source/C/VfrCompile/VfrSyntax.cpp:5783:31: warning[-Wsign-compare]: comparison of integer expressions of different signedness: ‘UINT32’ {aka ‘unsigned int’} and ‘int’
# 5783 |     if (!IntDecStyle && MinU4 > (1<< _GET_CURRQEST_VARTINFO().mVarTotalSize) -1) {
#      |                         ~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# 5781|     if (_GET_CURRQEST_VARTINFO().mIsBitVar) {

# 5782|       MinU4 = _STOU32(I->getText(), I->getLine());

# 5783|->     if (!IntDecStyle && MinU4 > (1<< _GET_CURRQEST_VARTINFO().mVarTotalSize) -1) {

# 5784|         _PCATCH (VFR_RETURN_INVALID_PARAMETER, I->getLine(), "BIT type minimum can't small than 0, bigger than 2^BitWidth -1");

# 5785|       }


Error: COMPILER_WARNING (CWE-195): [#def109]
edk2-20240813-build/edk2-b158dad150bf/BaseTools/Source/C/VfrCompile/VfrSyntax.cpp:5884:31: warning[-Wsign-compare]: comparison of integer expressions of different signedness: ‘UINT32’ {aka ‘unsigned int’} and ‘int’
# 5884 |     if (!IntDecStyle && MaxU4 > (1<< _GET_CURRQEST_VARTINFO().mVarTotalSize) -1) {
#      |                         ~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# 5882|     if (_GET_CURRQEST_VARTINFO().mIsBitVar) {

# 5883|       MaxU4 = _STOU32(A->getText(), A->getLine());

# 5884|->     if (!IntDecStyle && MaxU4 > (1<< _GET_CURRQEST_VARTINFO().mVarTotalSize) -1) {

# 5885|         _PCATCH (VFR_RETURN_INVALID_PARAMETER, A->getLine(), "BIT type maximum can't bigger than 2^BitWidth -1");

# 5886|       }


Error: COMPILER_WARNING (CWE-1164): [#def110]
edk2-20240813-build/edk2-b158dad150bf/BaseTools/Source/C/VfrCompile/VfrSyntax.cpp:7367:1: warning[-Wunused-label]: label ‘fail’ defined but not used
# 7367 | fail:
#      | ^~~~
# 7365|     }
# 7366|     return;
# 7367|-> fail:
# 7368|     syn(zzBadTok, (ANTLRChar *)"", zzMissSet, zzMissTok, zzErrk);
# 7369|     resynch(setwd29, 0x4);

Error: COMPILER_WARNING (CWE-1164): [#def111]
edk2-20240813-build/edk2-b158dad150bf/BaseTools/Source/C/VfrCompile/VfrSyntax.cpp:7437:1: warning[-Wunused-label]: label ‘fail’ defined but not used
# 7437 | fail:
#      | ^~~~
# 7435|     }
# 7436|     return;
# 7437|-> fail:
# 7438|     syn(zzBadTok, (ANTLRChar *)"", zzMissSet, zzMissTok, zzErrk);
# 7439|     resynch(setwd29, 0x80);

Error: COMPILER_WARNING (CWE-1164): [#def112]
edk2-20240813-build/edk2-b158dad150bf/BaseTools/Source/C/VfrCompile/VfrSyntax.cpp:8319:1: warning[-Wunused-label]: label ‘fail’ defined but not used
# 8319 | fail:
#      | ^~~~
# 8317|     vfrStatementOneOfOption();
# 8318|     return;
# 8319|-> fail:
# 8320|     syn(zzBadTok, (ANTLRChar *)"", zzMissSet, zzMissTok, zzErrk);
# 8321|     resynch(setwd38, 0x80);

Error: COMPILER_WARNING (CWE-563): [#def113]
edk2-20240813-build/edk2-b158dad150bf/BaseTools/Source/C/VfrCompile/VfrSyntax.cpp:8334:22: warning[-Wunused-variable]: unused variable ‘TypeError’
# 8334 |   BOOLEAN            TypeError     = FALSE;
#      |                      ^~~~~~~~~
# 8332|     CHAR8              *VarStoreName = NULL;

# 8333|     UINT32             Size          = 0;

# 8334|->   BOOLEAN            TypeError     = FALSE;

# 8335|     EFI_VFR_RETURN_CODE ReturnCode   = VFR_RETURN_SUCCESS;

# 8336|     EFI_GUID           *VarStoreGuid = NULL;


Error: COMPILER_WARNING (CWE-563): [#def114]
edk2-20240813-build/edk2-b158dad150bf/BaseTools/Source/C/VfrCompile/VfrSyntax.cpp: scope_hint: In member function ‘void EfiVfrParser::ideqvallistExp(UINT32&, UINT32&)’
edk2-20240813-build/edk2-b158dad150bf/BaseTools/Source/C/VfrCompile/VfrSyntax.cpp:9972:9: warning[-Wunused-variable]: unused variable ‘zzcnt’
# 9972 |     int zzcnt=1;
#      |         ^~~~~
# 9970|     zzmatch(236); consume();
# 9971|     {
# 9972|->     int zzcnt=1;
# 9973|       do {
# 9974|         zzmatch(Number);

Error: COMPILER_WARNING (CWE-563): [#def115]
edk2-20240813-build/edk2-b158dad150bf/BaseTools/Source/C/VfrCompile/VfrSyntax.cpp: scope_hint: In member function ‘EFI_HII_REF EfiVfrParser::_STOR(CHAR8*, CHAR8*, EFI_GUID*, CHAR8*, UINT32)’
edk2-20240813-build/edk2-b158dad150bf/BaseTools/Source/C/VfrCompile/VfrSyntax.cpp:11491:15: warning[-Wunused-variable]: unused variable ‘Index’
#11491 |   UINT32      Index;
#      |               ^~~~~
#11489|   {

#11490|     EFI_HII_REF Ref;

#11491|->   UINT32      Index;

#11492|     

#11493|     memcpy (&Ref.FormSetGuid, FormSetGuid, sizeof (EFI_GUID));


Error: COMPILER_WARNING (CWE-823): [#def116]
edk2-20240813-build/edk2-b158dad150bf/BaseTools/Source/C/VfrCompile/VfrUtilityLib.cpp: scope_hint: In member function ‘void CVfrQuestionDB::RegisterNewDateQuestion(CHAR8*, CHAR8*, EFI_QUESTION_ID&)’
edk2-20240813-build/edk2-b158dad150bf/BaseTools/Source/C/VfrCompile/VfrUtilityLib.cpp:2997:18: warning[-Wchar-subscripts]: array subscript has type ‘char’
# 2997 |     if (VarIdStr[Index] != NULL) {
#      |                  ^~~~~
# 2995|   

# 2996|     for (Index = 0; Index < 3; Index++) {

# 2997|->     if (VarIdStr[Index] != NULL) {

# 2998|         delete[] VarIdStr[Index];

# 2999|         VarIdStr[Index] = NULL;


Error: COMPILER_WARNING (CWE-823): [#def117]
edk2-20240813-build/edk2-b158dad150bf/BaseTools/Source/C/VfrCompile/VfrUtilityLib.cpp:2998:25: warning[-Wchar-subscripts]: array subscript has type ‘char’
# 2998 |       delete[] VarIdStr[Index];
#      |                         ^~~~~
# 2996|     for (Index = 0; Index < 3; Index++) {

# 2997|       if (VarIdStr[Index] != NULL) {

# 2998|->       delete[] VarIdStr[Index];

# 2999|         VarIdStr[Index] = NULL;

# 3000|       }


Error: COMPILER_WARNING (CWE-823): [#def118]
edk2-20240813-build/edk2-b158dad150bf/BaseTools/Source/C/VfrCompile/VfrUtilityLib.cpp:2999:16: warning[-Wchar-subscripts]: array subscript has type ‘char’
# 2999 |       VarIdStr[Index] = NULL;
#      |                ^~~~~
# 2997|       if (VarIdStr[Index] != NULL) {

# 2998|         delete[] VarIdStr[Index];

# 2999|->       VarIdStr[Index] = NULL;

# 3000|       }

# 3001|     }


Error: COMPILER_WARNING (CWE-823): [#def119]
edk2-20240813-build/edk2-b158dad150bf/BaseTools/Source/C/VfrCompile/VfrUtilityLib.cpp:3011:15: warning[-Wchar-subscripts]: array subscript has type ‘char’
# 3011 |     if (pNode[Index] != NULL) {
#      |               ^~~~~
# 3009|   Err:

# 3010|     for (Index = 0; Index < 3; Index++) {

# 3011|->     if (pNode[Index] != NULL) {

# 3012|         delete pNode[Index];

# 3013|       }


Error: COMPILER_WARNING (CWE-823): [#def120]
edk2-20240813-build/edk2-b158dad150bf/BaseTools/Source/C/VfrCompile/VfrUtilityLib.cpp:3012:20: warning[-Wchar-subscripts]: array subscript has type ‘char’
# 3012 |       delete pNode[Index];
#      |                    ^~~~~
# 3010|     for (Index = 0; Index < 3; Index++) {

# 3011|       if (pNode[Index] != NULL) {

# 3012|->       delete pNode[Index];

# 3013|       }

# 3014|   


Error: COMPILER_WARNING (CWE-823): [#def121]
edk2-20240813-build/edk2-b158dad150bf/BaseTools/Source/C/VfrCompile/VfrUtilityLib.cpp:3015:18: warning[-Wchar-subscripts]: array subscript has type ‘char’
# 3015 |     if (VarIdStr[Index] != NULL) {
#      |                  ^~~~~
# 3013|       }

# 3014|   

# 3015|->     if (VarIdStr[Index] != NULL) {

# 3016|         delete[] VarIdStr [Index];

# 3017|         VarIdStr [Index] = NULL;


Error: COMPILER_WARNING (CWE-823): [#def122]
edk2-20240813-build/edk2-b158dad150bf/BaseTools/Source/C/VfrCompile/VfrUtilityLib.cpp:3016:26: warning[-Wchar-subscripts]: array subscript has type ‘char’
# 3016 |       delete[] VarIdStr [Index];
#      |                          ^~~~~
# 3014|   

# 3015|       if (VarIdStr[Index] != NULL) {

# 3016|->       delete[] VarIdStr [Index];

# 3017|         VarIdStr [Index] = NULL;

# 3018|       }


Error: COMPILER_WARNING (CWE-823): [#def123]
edk2-20240813-build/edk2-b158dad150bf/BaseTools/Source/C/VfrCompile/VfrUtilityLib.cpp:3017:17: warning[-Wchar-subscripts]: array subscript has type ‘char’
# 3017 |       VarIdStr [Index] = NULL;
#      |                 ^~~~~
# 3015|       if (VarIdStr[Index] != NULL) {

# 3016|         delete[] VarIdStr [Index];

# 3017|->       VarIdStr [Index] = NULL;

# 3018|       }

# 3019|     }


Error: COMPILER_WARNING (CWE-823): [#def124]
edk2-20240813-build/edk2-b158dad150bf/BaseTools/Source/C/VfrCompile/VfrUtilityLib.cpp: scope_hint: In member function ‘void CVfrQuestionDB::RegisterNewTimeQuestion(CHAR8*, CHAR8*, EFI_QUESTION_ID&)’
edk2-20240813-build/edk2-b158dad150bf/BaseTools/Source/C/VfrCompile/VfrUtilityLib.cpp:3175:18: warning[-Wchar-subscripts]: array subscript has type ‘char’
# 3175 |     if (VarIdStr[Index] != NULL) {
#      |                  ^~~~~
# 3173|   

# 3174|     for (Index = 0; Index < 3; Index++) {

# 3175|->     if (VarIdStr[Index] != NULL) {

# 3176|         delete[] VarIdStr[Index];

# 3177|         VarIdStr[Index] = NULL;


Error: COMPILER_WARNING (CWE-823): [#def125]
edk2-20240813-build/edk2-b158dad150bf/BaseTools/Source/C/VfrCompile/VfrUtilityLib.cpp:3176:25: warning[-Wchar-subscripts]: array subscript has type ‘char’
# 3176 |       delete[] VarIdStr[Index];
#      |                         ^~~~~
# 3174|     for (Index = 0; Index < 3; Index++) {

# 3175|       if (VarIdStr[Index] != NULL) {

# 3176|->       delete[] VarIdStr[Index];

# 3177|         VarIdStr[Index] = NULL;

# 3178|       }


Error: COMPILER_WARNING (CWE-823): [#def126]
edk2-20240813-build/edk2-b158dad150bf/BaseTools/Source/C/VfrCompile/VfrUtilityLib.cpp:3177:16: warning[-Wchar-subscripts]: array subscript has type ‘char’
# 3177 |       VarIdStr[Index] = NULL;
#      |                ^~~~~
# 3175|       if (VarIdStr[Index] != NULL) {

# 3176|         delete[] VarIdStr[Index];

# 3177|->       VarIdStr[Index] = NULL;

# 3178|       }

# 3179|     }


Error: COMPILER_WARNING (CWE-823): [#def127]
edk2-20240813-build/edk2-b158dad150bf/BaseTools/Source/C/VfrCompile/VfrUtilityLib.cpp:3189:15: warning[-Wchar-subscripts]: array subscript has type ‘char’
# 3189 |     if (pNode[Index] != NULL) {
#      |               ^~~~~
# 3187|   Err:

# 3188|     for (Index = 0; Index < 3; Index++) {

# 3189|->     if (pNode[Index] != NULL) {

# 3190|         delete pNode[Index];

# 3191|       }


Error: COMPILER_WARNING (CWE-823): [#def128]
edk2-20240813-build/edk2-b158dad150bf/BaseTools/Source/C/VfrCompile/VfrUtilityLib.cpp:3190:20: warning[-Wchar-subscripts]: array subscript has type ‘char’
# 3190 |       delete pNode[Index];
#      |                    ^~~~~
# 3188|     for (Index = 0; Index < 3; Index++) {

# 3189|       if (pNode[Index] != NULL) {

# 3190|->       delete pNode[Index];

# 3191|       }

# 3192|   


Error: COMPILER_WARNING (CWE-823): [#def129]
edk2-20240813-build/edk2-b158dad150bf/BaseTools/Source/C/VfrCompile/VfrUtilityLib.cpp:3193:18: warning[-Wchar-subscripts]: array subscript has type ‘char’
# 3193 |     if (VarIdStr[Index] != NULL) {
#      |                  ^~~~~
# 3191|       }

# 3192|   

# 3193|->     if (VarIdStr[Index] != NULL) {

# 3194|         delete[] VarIdStr[Index];

# 3195|         VarIdStr[Index] = NULL;


Error: COMPILER_WARNING (CWE-823): [#def130]
edk2-20240813-build/edk2-b158dad150bf/BaseTools/Source/C/VfrCompile/VfrUtilityLib.cpp:3194:25: warning[-Wchar-subscripts]: array subscript has type ‘char’
# 3194 |       delete[] VarIdStr[Index];
#      |                         ^~~~~
# 3192|   

# 3193|       if (VarIdStr[Index] != NULL) {

# 3194|->       delete[] VarIdStr[Index];

# 3195|         VarIdStr[Index] = NULL;

# 3196|       }


Error: COMPILER_WARNING (CWE-823): [#def131]
edk2-20240813-build/edk2-b158dad150bf/BaseTools/Source/C/VfrCompile/VfrUtilityLib.cpp:3195:16: warning[-Wchar-subscripts]: array subscript has type ‘char’
# 3195 |       VarIdStr[Index] = NULL;
#      |                ^~~~~
# 3193|       if (VarIdStr[Index] != NULL) {

# 3194|         delete[] VarIdStr[Index];

# 3195|->       VarIdStr[Index] = NULL;

# 3196|       }

# 3197|     }


Error: COMPILER_WARNING (CWE-823): [#def132]
edk2-20240813-build/edk2-b158dad150bf/BaseTools/Source/C/VfrCompile/VfrUtilityLib.cpp: scope_hint: In member function ‘void CVfrQuestionDB::RegisterRefQuestion(CHAR8*, CHAR8*, EFI_QUESTION_ID&)’
edk2-20240813-build/edk2-b158dad150bf/BaseTools/Source/C/VfrCompile/VfrUtilityLib.cpp:3309:15: warning[-Wchar-subscripts]: array subscript has type ‘char’
# 3309 |     if (pNode[Index] != NULL) {
#      |               ^~~~~
# 3307|     Err:

# 3308|     for (Index = 0; Index < 4; Index++) {

# 3309|->     if (pNode[Index] != NULL) {

# 3310|         delete pNode[Index];

# 3311|       }


Error: COMPILER_WARNING (CWE-823): [#def133]
edk2-20240813-build/edk2-b158dad150bf/BaseTools/Source/C/VfrCompile/VfrUtilityLib.cpp:3310:20: warning[-Wchar-subscripts]: array subscript has type ‘char’
# 3310 |       delete pNode[Index];
#      |                    ^~~~~
# 3308|     for (Index = 0; Index < 4; Index++) {

# 3309|       if (pNode[Index] != NULL) {

# 3310|->       delete pNode[Index];

# 3311|       }

# 3312|   


Error: COMPILER_WARNING (CWE-823): [#def134]
edk2-20240813-build/edk2-b158dad150bf/BaseTools/Source/C/VfrCompile/VfrUtilityLib.cpp:3313:18: warning[-Wchar-subscripts]: array subscript has type ‘char’
# 3313 |     if (VarIdStr[Index] != NULL) {
#      |                  ^~~~~
# 3311|       }

# 3312|   

# 3313|->     if (VarIdStr[Index] != NULL) {

# 3314|         delete VarIdStr[Index];

# 3315|       }


Error: COMPILER_WARNING (CWE-823): [#def135]
edk2-20240813-build/edk2-b158dad150bf/BaseTools/Source/C/VfrCompile/VfrUtilityLib.cpp:3314:23: warning[-Wchar-subscripts]: array subscript has type ‘char’
# 3314 |       delete VarIdStr[Index];
#      |                       ^~~~~
# 3312|   

# 3313|       if (VarIdStr[Index] != NULL) {

# 3314|->       delete VarIdStr[Index];

# 3315|       }

# 3316|     }


Error: COMPILER_WARNING (CWE-563): [#def136]
edk2-20240813-build/edk2-b158dad150bf/BaseTools/Source/C/VfrCompile/VfrUtilityLib.cpp: scope_hint: In member function ‘CHAR8* CVfrStringDB::GetVarStoreNameFormStringId(EFI_STRING_ID)’
edk2-20240813-build/edk2-b158dad150bf/BaseTools/Source/C/VfrCompile/VfrUtilityLib.cpp:3569:15: warning[-Wunused-variable]: unused variable ‘LineBuf’
# 3569 |   CHAR8       LineBuf[EFI_IFR_MAX_LENGTH];
#      |               ^~~~~~~
# 3567|     UINT8       *Current;

# 3568|     EFI_STATUS  Status;

# 3569|->   CHAR8       LineBuf[EFI_IFR_MAX_LENGTH];

# 3570|     UINT8       BlockType;

# 3571|     EFI_HII_STRING_PACKAGE_HDR *PkgHeader;


Error: COMPILER_WARNING (CWE-563): [#def137]
edk2-20240813-build/edk2-b158dad150bf/BaseTools/Source/C/VfrCompile/VfrFormPkg.h:16: included_from: Included from here.
edk2-20240813-build/edk2-b158dad150bf/BaseTools/Source/C/VfrCompile/VfrUtilityLib.h:18:17: warning[-Wunused-variable]: ‘gEdkiiIfrBitVarGuid’ defined but not used
#   18 | static EFI_GUID gEdkiiIfrBitVarGuid = EDKII_IFR_BIT_VARSTORE_GUID;
#      |                 ^~~~~~~~~~~~~~~~~~~
#   16|   #include "VfrError.h"

#   17|   

#   18|-> static EFI_GUID gEdkiiIfrBitVarGuid = EDKII_IFR_BIT_VARSTORE_GUID;

#   19|   

#   20|   #define MAX_BIT_WIDTH                      32


Error: CPPCHECK_WARNING (CWE-758): [#def138]
edk2-20240813-build/edk2-b158dad150bf/CryptoPkg/Library/OpensslLib/openssl/crypto/bn/bn_gcd.c:614: error[shiftTooManyBitsSigned]: Shifting signed 32-bit value by 31 bits is undefined behaviour
#  612|       for (i = 0; i < m; i++) {
#  613|           /* conditionally flip signs if delta is positive and g is odd */
#  614|->         cond = (-delta >> (8 * sizeof(delta) - 1)) & g->d[0] & 1
#  615|               /* make sure g->top > 0 (i.e. if top == 0 then g == 0 always) */
#  616|               & (~((g->top - 1) >> (sizeof(g->top) * 8 - 1)));

Error: CPPCHECK_WARNING (CWE-758): [#def139]
edk2-20240813-build/edk2-b158dad150bf/CryptoPkg/Library/OpensslLib/openssl/crypto/bn/bn_lib.c:45: error[shiftTooManyBitsSigned]: Shifting signed 32-bit value by 31 bits is undefined behaviour
#   43|               mult = sizeof(int) * 8 - 1;
#   44|           bn_limit_bits = mult;
#   45|->         bn_limit_num = 1 << mult;
#   46|       }
#   47|       if (high >= 0) {

Error: CPPCHECK_WARNING (CWE-758): [#def140]
edk2-20240813-build/edk2-b158dad150bf/CryptoPkg/Library/OpensslLib/openssl/crypto/bn/bn_lib.c:51: error[shiftTooManyBitsSigned]: Shifting signed 32-bit value by 31 bits is undefined behaviour
#   49|               high = sizeof(int) * 8 - 1;
#   50|           bn_limit_bits_high = high;
#   51|->         bn_limit_num_high = 1 << high;
#   52|       }
#   53|       if (low >= 0) {

Error: CPPCHECK_WARNING (CWE-758): [#def141]
edk2-20240813-build/edk2-b158dad150bf/CryptoPkg/Library/OpensslLib/openssl/crypto/bn/bn_lib.c:57: error[shiftTooManyBitsSigned]: Shifting signed 32-bit value by 31 bits is undefined behaviour
#   55|               low = sizeof(int) * 8 - 1;
#   56|           bn_limit_bits_low = low;
#   57|->         bn_limit_num_low = 1 << low;
#   58|       }
#   59|       if (mont >= 0) {

Error: CPPCHECK_WARNING (CWE-758): [#def142]
edk2-20240813-build/edk2-b158dad150bf/CryptoPkg/Library/OpensslLib/openssl/crypto/bn/bn_lib.c:63: error[shiftTooManyBitsSigned]: Shifting signed 32-bit value by 31 bits is undefined behaviour
#   61|               mont = sizeof(int) * 8 - 1;
#   62|           bn_limit_bits_mont = mont;
#   63|->         bn_limit_num_mont = 1 << mont;
#   64|       }
#   65|   }

Error: CPPCHECK_WARNING (CWE-758): [#def143]
edk2-20240813-build/edk2-b158dad150bf/CryptoPkg/Library/OpensslLib/openssl/crypto/modes/gcm128.c:590: error[shiftTooManyBitsSigned]: Shifting signed 64-bit value by 63 bits is undefined behaviour
#  588|   
#  589|           for (i = 0; i < 8 * sizeof(long); ++i, X <<= 1) {
#  590|->             u64 M = (u64)(X >> (8 * sizeof(long) - 1));
#  591|               Z.hi ^= V.hi & M;
#  592|               Z.lo ^= V.lo & M;

Error: CPPCHECK_WARNING (CWE-758): [#def144]
edk2-20240813-build/edk2-b158dad150bf/CryptoPkg/Library/OpensslLib/openssl/crypto/modes/xts128.c:74: error[shiftTooManyBitsSigned]: Shifting signed 32-bit value by 31 bits is undefined behaviour
#   72|               unsigned int carry, res;
#   73|   
#   74|->             res = 0x87 & (((int)tweak.d[3]) >> 31);
#   75|               carry = (unsigned int)(tweak.u[0] >> 63);
#   76|               tweak.u[0] = (tweak.u[0] << 1) ^ res;

Error: CPPCHECK_WARNING (CWE-758): [#def145]
edk2-20240813-build/edk2-b158dad150bf/CryptoPkg/Library/OpensslLib/openssl/crypto/modes/xts128.c:113: error[shiftTooManyBitsSigned]: Shifting signed 32-bit value by 31 bits is undefined behaviour
#  111|               unsigned int carry, res;
#  112|   
#  113|->             res = 0x87 & (((int)tweak.d[3]) >> 31);
#  114|               carry = (unsigned int)(tweak.u[0] >> 63);
#  115|               tweak1.u[0] = (tweak.u[0] << 1) ^ res;

Error: GCC_ANALYZER_WARNING (CWE-457): [#def146]
edk2-20240813-build/edk2-b158dad150bf/CryptoPkg/Library/TlsLib/TlsConfig.c: scope_hint: In function ‘TlsSetCipherList’
edk2-20240813-build/edk2-b158dad150bf/CryptoPkg/Library/TlsLib/TlsConfig.c:266:29: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value ‘OpensslCipher’
edk2-20240813-build/edk2-b158dad150bf/CryptoPkg/Library/TlsLib/InternalTlsLib.h:24: included_from: Included from here.
edk2-20240813-build/edk2-b158dad150bf/CryptoPkg/Library/TlsLib/TlsConfig.c:10: included_from: Included from here.
edk2-20240813-build/edk2-b158dad150bf/CryptoPkg/Library/TlsLib/TlsConfig.c:235:21: note: in expansion of macro ‘sk_SSL_CIPHER_num’
#  264|       Status = SafeUintnAdd (

#  265|                  CipherStringSize,

#  266|->                AsciiStrLen (SSL_CIPHER_get_name (OpensslCipher)),

#  267|                  &CipherStringSize

#  268|                  );


Error: GCC_ANALYZER_WARNING (CWE-476): [#def147]
edk2-20240813-build/edk2-b158dad150bf/MdeModulePkg/Bus/Ata/AtaBusDxe/AtaPassThruExecute.c: scope_hint: In function ‘AccessAtaDevice’
edk2-20240813-build/edk2-b158dad150bf/MdeModulePkg/Bus/Ata/AtaBusDxe/AtaPassThruExecute.c:932:35: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘EventCount’
edk2-20240813-build/edk2-b158dad150bf/MdePkg/Include/Uefi/UefiBaseType.h:16: included_from: Included from here.
edk2-20240813-build/edk2-b158dad150bf/MdePkg/Include/Uefi.h:17: included_from: Included from here.
edk2-20240813-build/edk2-b158dad150bf/Build/OvmfX64/DEBUG_GCC5/X64/MdeModulePkg/Bus/Ata/AtaBusDxe/AtaBusDxe/DEBUG/AutoGen.h:16: included_from: Included from here.
<command-line>: included_from: Included from here.
edk2-20240813-build/edk2-b158dad150bf/MdePkg/Include/Uefi/UefiBaseType.h:161:23: note: in expansion of macro ‘RETURN_ERROR’
edk2-20240813-build/edk2-b158dad150bf/MdeModulePkg/Bus/Ata/AtaBusDxe/AtaPassThruExecute.c:929:9: note: in expansion of macro ‘EFI_ERROR’
#  930|         OldTpl                   = gBS->RaiseTPL (TPL_NOTIFY);

#  931|         Token->TransactionStatus = Status;

#  932|->       *EventCount              = (*EventCount) - (TempCount - Index);

#  933|         *IsError                 = TRUE;

#  934|   


Error: GCC_ANALYZER_WARNING (CWE-476): [#def148]
edk2-20240813-build/edk2-b158dad150bf/MdeModulePkg/Bus/Pci/EhciDxe/UsbHcMem.c: scope_hint: In function ‘UsbHcInsertMemBlockToPool’
edk2-20240813-build/edk2-b158dad150bf/MdeModulePkg/Bus/Pci/EhciDxe/UsbHcMem.c:280:21: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘Head’
edk2-20240813-build/edk2-b158dad150bf/MdeModulePkg/Bus/Pci/EhciDxe/Ehci.h:21: included_from: Included from here.
edk2-20240813-build/edk2-b158dad150bf/MdeModulePkg/Bus/Pci/EhciDxe/UsbHcMem.c:10: included_from: Included from here.
edk2-20240813-build/edk2-b158dad150bf/MdeModulePkg/Bus/Pci/EhciDxe/UsbHcMem.c:46:3: note: in expansion of macro ‘ASSERT’
#  278|   {

#  279|     ASSERT ((Head != NULL) && (Block != NULL));

#  280|->   Block->Next = Head->Next;

#  281|     Head->Next  = Block;

#  282|   }


Error: GCC_ANALYZER_WARNING (CWE-476): [#def149]
edk2-20240813-build/edk2-b158dad150bf/MdeModulePkg/Bus/Pci/PciBusDxe/PciDeviceSupport.c: scope_hint: In function ‘StartPciDevices’
edk2-20240813-build/edk2-b158dad150bf/MdeModulePkg/Bus/Pci/PciBusDxe/PciDeviceSupport.c:776:30: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘RootBridge’
#  774|     RootBridge = GetRootBridgeByHandle (Controller);

#  775|     ASSERT (RootBridge != NULL);

#  776|->   ThisHostBridge = RootBridge->PciRootBridgeIo->ParentHandle;

#  777|   

#  778|     CurrentLink = mPciDevicePool.ForwardLink;


Error: GCC_ANALYZER_WARNING (CWE-126): [#def150]
edk2-20240813-build/edk2-b158dad150bf/MdeModulePkg/Bus/Pci/PciSioSerialDxe/Serial.c: scope_hint: In function ‘SerialControllerDriverStart’
edk2-20240813-build/edk2-b158dad150bf/MdeModulePkg/Bus/Pci/PciSioSerialDxe/Serial.c:1006:32: warning[-Wanalyzer-out-of-bounds]: buffer over-read
<command-line>: included_from: Included from here.
edk2-20240813-build/edk2-b158dad150bf/MdeModulePkg/Bus/Pci/PciSioSerialDxe/Serial.h:28: included_from: Included from here.
edk2-20240813-build/edk2-b158dad150bf/MdeModulePkg/Bus/Pci/PciSioSerialDxe/Serial.c:9: included_from: Included from here.
edk2-20240813-build/edk2-b158dad150bf/MdeModulePkg/Bus/Pci/PciSioSerialDxe/Serial.c:852:3: note: in expansion of macro ‘REPORT_STATUS_CODE_WITH_DEVICE_PATH’
edk2-20240813-build/edk2-b158dad150bf/MdeModulePkg/Bus/Pci/PciSioSerialDxe/Serial.c:1006:32: note: read of 2 bytes from after the end of ‘_gPcd_FixedAtBuild_PcdPciSerialParameters’
edk2-20240813-build/edk2-b158dad150bf/MdeModulePkg/Bus/Pci/PciSioSerialDxe/Serial.c:1006:32: note: valid subscripts for ‘_gPcd_FixedAtBuild_PcdPciSerialParameters’ are ‘[0]’ to ‘[1]’
# 1004|         for (PciSerialParameter = PcdGetPtr (PcdPciSerialParameters); PciSerialParameter->VendorId != 0xFFFF; PciSerialParameter++) {

# 1005|           if ((PciSerialParameter->VendorId == Pci.Hdr.VendorId) &&

# 1006|->             (PciSerialParameter->DeviceId == Pci.Hdr.DeviceId)

# 1007|               )

# 1008|           {


Error: GCC_ANALYZER_WARNING (CWE-476): [#def151]
edk2-20240813-build/edk2-b158dad150bf/MdeModulePkg/Bus/Pci/UhciDxe/UhciSched.c: scope_hint: In function ‘UhciLinkQhToFrameList’
edk2-20240813-build/edk2-b158dad150bf/MdeModulePkg/Bus/Pci/UhciDxe/UhciSched.c:285:16: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘Next’
edk2-20240813-build/edk2-b158dad150bf/MdeModulePkg/Bus/Pci/UhciDxe/Uhci.h:21: included_from: Included from here.
edk2-20240813-build/edk2-b158dad150bf/MdeModulePkg/Bus/Pci/UhciDxe/UhciSched.c:10: included_from: Included from here.
edk2-20240813-build/edk2-b158dad150bf/MdeModulePkg/Bus/Pci/UhciDxe/UhciSched.c:267:5: note: in expansion of macro ‘ASSERT’
#  283|       // rate is correct.

#  284|       //

#  285|->     while (Next->Interval > Qh->Interval) {

#  286|         Prev = Next;

#  287|         Next = Next->NextQh;


Error: GCC_ANALYZER_WARNING (CWE-476): [#def152]
edk2-20240813-build/edk2-b158dad150bf/MdeModulePkg/Bus/Pci/UhciDxe/UsbHcMem.c: scope_hint: In function ‘UsbHcInsertMemBlockToPool’
edk2-20240813-build/edk2-b158dad150bf/MdeModulePkg/Bus/Pci/UhciDxe/UsbHcMem.c:280:21: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘Head’
edk2-20240813-build/edk2-b158dad150bf/MdeModulePkg/Bus/Pci/UhciDxe/Uhci.h:21: included_from: Included from here.
edk2-20240813-build/edk2-b158dad150bf/MdeModulePkg/Bus/Pci/UhciDxe/UsbHcMem.c:10: included_from: Included from here.
edk2-20240813-build/edk2-b158dad150bf/MdeModulePkg/Bus/Pci/UhciDxe/UsbHcMem.c:46:3: note: in expansion of macro ‘ASSERT’
#  278|   {

#  279|     ASSERT ((Head != NULL) && (Block != NULL));

#  280|->   Block->Next = Head->Next;

#  281|     Head->Next  = Block;

#  282|   }


Error: GCC_ANALYZER_WARNING (CWE-476): [#def153]
edk2-20240813-build/edk2-b158dad150bf/MdeModulePkg/Bus/Pci/XhciDxe/UsbHcMem.c: scope_hint: In function ‘UsbHcGetPciAddrForHostAddr’
edk2-20240813-build/edk2-b158dad150bf/MdeModulePkg/Bus/Pci/XhciDxe/UsbHcMem.c:273:33: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘Block’
#  271|     // calculate the pci memory address for host memory address.

#  272|     //

#  273|->   Offset  = (UINT8 *)Mem - Block->BufHost;

#  274|     PhyAddr = (EFI_PHYSICAL_ADDRESS)(UINTN)(Block->Buf + Offset);

#  275|     return PhyAddr;


Error: GCC_ANALYZER_WARNING (CWE-476): [#def154]
edk2-20240813-build/edk2-b158dad150bf/MdeModulePkg/Bus/Pci/XhciDxe/UsbHcMem.c: scope_hint: In function ‘UsbHcGetHostAddrForPciAddr’
edk2-20240813-build/edk2-b158dad150bf/MdeModulePkg/Bus/Pci/XhciDxe/UsbHcMem.c:328:34: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘Block’
#  326|     // calculate the pci memory address for host memory address.

#  327|     //

#  328|->   Offset   = (UINT8 *)Mem - Block->Buf;

#  329|     HostAddr = (EFI_PHYSICAL_ADDRESS)(UINTN)(Block->BufHost + Offset);

#  330|     return HostAddr;


Error: GCC_ANALYZER_WARNING (CWE-476): [#def155]
edk2-20240813-build/edk2-b158dad150bf/MdeModulePkg/Bus/Pci/XhciDxe/UsbHcMem.c: scope_hint: In function ‘UsbHcInsertMemBlockToPool’
edk2-20240813-build/edk2-b158dad150bf/MdeModulePkg/Bus/Pci/XhciDxe/UsbHcMem.c:347:21: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘Head’
edk2-20240813-build/edk2-b158dad150bf/MdeModulePkg/Bus/Pci/XhciDxe/Xhci.h:28: included_from: Included from here.
edk2-20240813-build/edk2-b158dad150bf/MdeModulePkg/Bus/Pci/XhciDxe/UsbHcMem.c:10: included_from: Included from here.
edk2-20240813-build/edk2-b158dad150bf/MdeModulePkg/Bus/Pci/XhciDxe/UsbHcMem.c:46:3: note: in expansion of macro ‘ASSERT’
#  345|   {

#  346|     ASSERT ((Head != NULL) && (Block != NULL));

#  347|->   Block->Next = Head->Next;

#  348|     Head->Next  = Block;

#  349|   }


Error: GCC_ANALYZER_WARNING (CWE-476): [#def156]
edk2-20240813-build/edk2-b158dad150bf/MdeModulePkg/Bus/Pci/XhciDxe/UsbHcMem.c: scope_hint: In function ‘UsbHcIsMemBlockEmpty’
edk2-20240813-build/edk2-b158dad150bf/MdeModulePkg/Bus/Pci/XhciDxe/UsbHcMem.c:367:32: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘Block’
#  365|     UINTN  Index;

#  366|   

#  367|->   for (Index = 0; Index < Block->BitsLen; Index++) {

#  368|       if (Block->Bits[Index] != 0) {

#  369|         return FALSE;


Error: GCC_ANALYZER_WARNING (CWE-457): [#def157]
edk2-20240813-build/edk2-b158dad150bf/MdeModulePkg/Bus/Usb/UsbKbDxe/KeyBoard.c: scope_hint: In function ‘USBParseKey’
edk2-20240813-build/edk2-b158dad150bf/MdeModulePkg/Bus/Usb/UsbKbDxe/KeyBoard.c:1266:64: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value ‘UsbKey.KeyCode’
# 1264|       Dequeue (&UsbKeyboardDevice->UsbKeyQueue, &UsbKey, sizeof (UsbKey));

# 1265|   

# 1266|->     KeyDescriptor = GetKeyDescriptor (UsbKeyboardDevice, UsbKey.KeyCode);

# 1267|       if (KeyDescriptor == NULL) {

# 1268|         continue;


Error: GCC_ANALYZER_WARNING (CWE-476): [#def158]
edk2-20240813-build/edk2-b158dad150bf/MdeModulePkg/Core/Dxe/Misc/MemoryAttributesTable.c: scope_hint: In function ‘EnforceMemoryMapAttribute’
edk2-20240813-build/edk2-b158dad150bf/MdeModulePkg/Core/Dxe/Misc/MemoryAttributesTable.c:450:27: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘MemoryMapEntry’
edk2-20240813-build/edk2-b158dad150bf/MdeModulePkg/Core/Dxe/Misc/MemoryAttributesTable.c:15: included_from: Included from here.
edk2-20240813-build/edk2-b158dad150bf/MdeModulePkg/Core/Dxe/Misc/MemoryAttributesTable.c:536:5: note: in expansion of macro ‘ASSERT’
#  448|     MemoryMapEnd   = (EFI_MEMORY_DESCRIPTOR *)((UINT8 *)MemoryMap + MemoryMapSize);

#  449|     while ((UINTN)MemoryMapEntry < (UINTN)MemoryMapEnd) {

#  450|->     switch (MemoryMapEntry->Type) {

#  451|         case EfiRuntimeServicesCode:

#  452|           // do nothing


Error: GCC_ANALYZER_WARNING (CWE-127): [#def159]
edk2-20240813-build/edk2-b158dad150bf/MdeModulePkg/Core/Pei/Dependency/Dependency.c: scope_hint: In function ‘IsPpiInstalled’
edk2-20240813-build/edk2-b158dad150bf/MdeModulePkg/Core/Pei/Dependency/Dependency.c:43:12: warning[-Wanalyzer-out-of-bounds]: stack-based buffer under-read
edk2-20240813-build/edk2-b158dad150bf/MdeModulePkg/Core/Pei/PeiMain.h:30: included_from: Included from here.
edk2-20240813-build/edk2-b158dad150bf/MdeModulePkg/Core/Pei/Dependency/Dependency.c:13: included_from: Included from here.
edk2-20240813-build/edk2-b158dad150bf/MdeModulePkg/Core/Pei/Dependency/Dependency.c:135:11: note: in expansion of macro ‘DEBUG’
edk2-20240813-build/edk2-b158dad150bf/MdeModulePkg/Core/Pei/Dependency/Dependency.c:43:12: note: valid subscripts for ‘EvalStack’ are ‘[0]’ to ‘[63]’
#   41|     // If there is no GUID to evaluate, just return current result on stack.

#   42|     //

#   43|->   if (Stack->Operator == NULL) {

#   44|       return Stack->Result;

#   45|     }


Error: GCC_ANALYZER_WARNING (CWE-127): [#def160]
edk2-20240813-build/edk2-b158dad150bf/MdeModulePkg/Core/Pei/Dependency/Dependency.c:44:17: warning[-Wanalyzer-out-of-bounds]: stack-based buffer under-read
edk2-20240813-build/edk2-b158dad150bf/MdeModulePkg/Core/Pei/Dependency/Dependency.c:135:11: note: in expansion of macro ‘DEBUG’
edk2-20240813-build/edk2-b158dad150bf/MdeModulePkg/Core/Pei/Dependency/Dependency.c:44:17: note: valid subscripts for ‘EvalStack’ are ‘[0]’ to ‘[63]’
#   42|     //

#   43|     if (Stack->Operator == NULL) {

#   44|->     return Stack->Result;

#   45|     }

#   46|   


Error: GCC_ANALYZER_WARNING (CWE-124): [#def161]
edk2-20240813-build/edk2-b158dad150bf/MdeModulePkg/Core/Pei/Dependency/Dependency.c: scope_hint: In function ‘PeimDispatchReadiness’
edk2-20240813-build/edk2-b158dad150bf/MdeModulePkg/Core/Pei/Dependency/Dependency.c:168:36: warning[-Wanalyzer-out-of-bounds]: stack-based buffer underwrite
edk2-20240813-build/edk2-b158dad150bf/MdeModulePkg/Core/Pei/Dependency/Dependency.c:135:11: note: in expansion of macro ‘DEBUG’
edk2-20240813-build/edk2-b158dad150bf/MdeModulePkg/Core/Pei/Dependency/Dependency.c:168:36: note: valid subscripts for ‘EvalStack’ are ‘[0]’ to ‘[63]’
#  166|           if (*(Iterator - 1) == EFI_DEP_AND) {

#  167|             if (!(IsPpiInstalled (PeiServices, StackPtr))) {

#  168|->             (StackPtr-1)->Result   = FALSE;

#  169|               (StackPtr-1)->Operator = NULL;

#  170|             }


Error: GCC_ANALYZER_WARNING (CWE-124): [#def162]
edk2-20240813-build/edk2-b158dad150bf/MdeModulePkg/Core/Pei/Dependency/Dependency.c:169:36: warning[-Wanalyzer-out-of-bounds]: stack-based buffer underwrite
edk2-20240813-build/edk2-b158dad150bf/MdeModulePkg/Core/Pei/Dependency/Dependency.c:135:11: note: in expansion of macro ‘DEBUG’
edk2-20240813-build/edk2-b158dad150bf/MdeModulePkg/Core/Pei/Dependency/Dependency.c:169:36: note: valid subscripts for ‘EvalStack’ are ‘[0]’ to ‘[63]’
#  167|             if (!(IsPpiInstalled (PeiServices, StackPtr))) {

#  168|               (StackPtr-1)->Result   = FALSE;

#  169|->             (StackPtr-1)->Operator = NULL;

#  170|             }

#  171|           } else {


Error: GCC_ANALYZER_WARNING (CWE-476): [#def163]
edk2-20240813-build/edk2-b158dad150bf/MdeModulePkg/Core/Pei/Dispatcher/Dispatcher.c: scope_hint: In function ‘PeiDispatcher’
edk2-20240813-build/edk2-b158dad150bf/MdeModulePkg/Core/Pei/Dispatcher/Dispatcher.c:1669:15: warning[-Wanalyzer-jump-through-null]: jump through null pointer
<command-line>: included_from: Included from here.
edk2-20240813-build/edk2-b158dad150bf/MdePkg/Include/Library/PcdLib.h:401:32: note: in expansion of macro ‘_PCD_GET_MODE_BOOL_PcdMigrateTemporaryRamFirmwareVolumes’
edk2-20240813-build/edk2-b158dad150bf/MdeModulePkg/Core/Pei/Dispatcher/Dispatcher.c:1640:18: note: in expansion of macro ‘PcdGetBool’
# 1667|   

# 1668|                 ASSERT (PeimEntryPoint != NULL);

# 1669|->               PeimEntryPoint (PeimFileHandle, (const EFI_PEI_SERVICES **)PeiServices);

# 1670|                 // PERF_END (PeiServices, L"PEIM", PeimFileHandle, 0);

# 1671|   


Error: GCC_ANALYZER_WARNING (CWE-476): [#def164]
edk2-20240813-build/edk2-b158dad150bf/MdeModulePkg/Core/PiSmmCore/Locate.c: scope_hint: In function ‘SmmLocateHandle’
edk2-20240813-build/edk2-b158dad150bf/MdeModulePkg/Core/PiSmmCore/Locate.c:375:21: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘ResultBuffer’
#  373|       ResultSize += sizeof (Handle);

#  374|       if (ResultSize <= *BufferSize) {

#  375|->       *ResultBuffer = Handle;

#  376|         ResultBuffer += 1;

#  377|       }


Error: GCC_ANALYZER_WARNING (CWE-476): [#def165]
edk2-20240813-build/edk2-b158dad150bf/MdeModulePkg/Core/PiSmmCore/MemoryAttributesTable.c: scope_hint: In function ‘EnforceMemoryMapAttribute’
edk2-20240813-build/edk2-b158dad150bf/MdeModulePkg/Core/PiSmmCore/MemoryAttributesTable.c:137:23: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘MemoryMapEntry’
edk2-20240813-build/edk2-b158dad150bf/MdeModulePkg/Core/PiSmmCore/MemoryAttributesTable.c:15: included_from: Included from here.
edk2-20240813-build/edk2-b158dad150bf/MdeModulePkg/Core/PiSmmCore/MemoryAttributesTable.c:232:7: note: in expansion of macro ‘ASSERT’
#  135|     MemoryMapEnd   = (EFI_MEMORY_DESCRIPTOR *)((UINT8 *)MemoryMap + MemoryMapSize);

#  136|     while ((UINTN)MemoryMapEntry < (UINTN)MemoryMapEnd) {

#  137|->     if (MemoryMapEntry->Attribute != 0) {

#  138|         // It is PE image, the attribute is already set.

#  139|       } else {


Error: GCC_ANALYZER_WARNING (CWE-457): [#def166]
edk2-20240813-build/edk2-b158dad150bf/MdeModulePkg/Core/PiSmmCore/Page.c: scope_hint: In function ‘SmmInternalAllocatePagesEx’
edk2-20240813-build/edk2-b158dad150bf/MdeModulePkg/Core/PiSmmCore/Page.c:611:20: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value ‘*Memory’
#  609|     // We don't track memory type in SMM

#  610|     //

#  611|->   RequestedAddress = (UINTN)*Memory;

#  612|     switch (Type) {

#  613|       case AllocateAnyPages:


Error: GCC_ANALYZER_WARNING (CWE-476): [#def167]
edk2-20240813-build/edk2-b158dad150bf/MdeModulePkg/Library/BootLogoLib/BootLogoLib.c: scope_hint: In function ‘BootLogoEnableLogo’
edk2-20240813-build/edk2-b158dad150bf/MdeModulePkg/Library/BootLogoLib/BootLogoLib.c:117:21: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘UgaDraw’
edk2-20240813-build/edk2-b158dad150bf/MdeModulePkg/Library/BootLogoLib/BootLogoLib.c:24: included_from: Included from here.
edk2-20240813-build/edk2-b158dad150bf/MdeModulePkg/Library/BootLogoLib/BootLogoLib.c:116:5: note: in expansion of macro ‘ASSERT’
#  115|     } else {

#  116|       ASSERT (UgaDraw != NULL);

#  117|->     Status = UgaDraw->GetMode (UgaDraw, &SizeOfX, &SizeOfY, &ColorDepth, &RefreshRate);

#  118|       if (EFI_ERROR (Status)) {

#  119|         return EFI_UNSUPPORTED;


Error: GCC_ANALYZER_WARNING (CWE-476): [#def168]
edk2-20240813-build/edk2-b158dad150bf/MdeModulePkg/Library/BootLogoLib/BootLogoLib.c:224:25: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘UgaDraw’
#  222|         } else {

#  223|           ASSERT (UgaDraw != NULL);

#  224|->         Status = UgaDraw->Blt (

#  225|                               UgaDraw,

#  226|                               (EFI_UGA_PIXEL *)Blt,


Error: GCC_ANALYZER_WARNING (CWE-476): [#def169]
edk2-20240813-build/edk2-b158dad150bf/MdeModulePkg/Library/BootLogoLib/BootLogoLib.c: scope_hint: In function ‘BootLogoUpdateProgress’
edk2-20240813-build/edk2-b158dad150bf/MdeModulePkg/Library/BootLogoLib/BootLogoLib.c:494:23: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘UgaDraw’
<command-line>: included_from: Included from here.
edk2-20240813-build/edk2-b158dad150bf/MdePkg/Include/Library/PcdLib.h:50:35: note: in expansion of macro ‘_PCD_GET_MODE_BOOL_PcdUgaConsumeSupport’
edk2-20240813-build/edk2-b158dad150bf/MdeModulePkg/Library/BootLogoLib/BootLogoLib.c:493:16: note: in expansion of macro ‘FeaturePcdGet’
#  492|                                    );

#  493|       } else if (FeaturePcdGet (PcdUgaConsumeSupport)) {

#  494|->       Status = UgaDraw->Blt (

#  495|                             UgaDraw,

#  496|                             (EFI_UGA_PIXEL *)&Color,


Error: GCC_ANALYZER_WARNING (CWE-476): [#def170]
edk2-20240813-build/edk2-b158dad150bf/MdeModulePkg/Library/BootLogoLib/BootLogoLib.c:530:23: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘UgaDraw’
edk2-20240813-build/edk2-b158dad150bf/MdePkg/Include/Library/PcdLib.h:50:35: note: in expansion of macro ‘_PCD_GET_MODE_BOOL_PcdUgaConsumeSupport’
edk2-20240813-build/edk2-b158dad150bf/MdeModulePkg/Library/BootLogoLib/BootLogoLib.c:529:16: note: in expansion of macro ‘FeaturePcdGet’
#  528|                                    );

#  529|       } else if (FeaturePcdGet (PcdUgaConsumeSupport)) {

#  530|->       Status = UgaDraw->Blt (

#  531|                             UgaDraw,

#  532|                             (EFI_UGA_PIXEL *)&ProgressColor,


Error: GCC_ANALYZER_WARNING (CWE-476): [#def171]
edk2-20240813-build/edk2-b158dad150bf/MdeModulePkg/Library/BootMaintenanceManagerUiLib/BootOption.c: scope_hint: In function ‘BOpt_GetBootOptions’
edk2-20240813-build/edk2-b158dad150bf/MdeModulePkg/Library/BootMaintenanceManagerUiLib/BootOption.c:368:20: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘NewMenuEntry’
#  366|       ASSERT (NULL != NewMenuEntry);

#  367|   

#  368|->     NewLoadContext = (BM_LOAD_CONTEXT *)NewMenuEntry->VariableContext;

#  369|   

#  370|       LoadOptionPtr = LoadOptionFromVar;


Error: GCC_ANALYZER_WARNING (CWE-476): [#def172]
edk2-20240813-build/edk2-b158dad150bf/MdeModulePkg/Library/BootMaintenanceManagerUiLib/UpdatePage.c: scope_hint: In function ‘UpdateConsolePage’
edk2-20240813-build/edk2-b158dad150bf/MdeModulePkg/Library/BootMaintenanceManagerUiLib/UpdatePage.c:499:27: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘ConsoleCheck’
edk2-20240813-build/edk2-b158dad150bf/MdeModulePkg/Library/BootMaintenanceManagerUiLib/BootMaintenanceManager.h:28: included_from: Included from here.
edk2-20240813-build/edk2-b158dad150bf/MdeModulePkg/Library/BootMaintenanceManagerUiLib/UpdatePage.c:9: included_from: Included from here.
edk2-20240813-build/edk2-b158dad150bf/MdeModulePkg/Library/BootMaintenanceManagerUiLib/UpdatePage.c:489:3: note: in expansion of macro ‘ASSERT’
#  497|       if (NewConsoleContext->IsActive) {

#  498|         CheckFlags         |= EFI_IFR_CHECKBOX_DEFAULT;

#  499|->       ConsoleCheck[Index] = TRUE;

#  500|       } else {

#  501|         ConsoleCheck[Index] = FALSE;


Error: GCC_ANALYZER_WARNING (CWE-476): [#def173]
edk2-20240813-build/edk2-b158dad150bf/MdeModulePkg/Library/BootMaintenanceManagerUiLib/UpdatePage.c:501:27: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘ConsoleCheck’
edk2-20240813-build/edk2-b158dad150bf/MdeModulePkg/Library/BootMaintenanceManagerUiLib/UpdatePage.c:489:3: note: in expansion of macro ‘ASSERT’
#  499|         ConsoleCheck[Index] = TRUE;

#  500|       } else {

#  501|->       ConsoleCheck[Index] = FALSE;

#  502|       }

#  503|   


Error: GCC_ANALYZER_WARNING (CWE-476): [#def174]
edk2-20240813-build/edk2-b158dad150bf/MdeModulePkg/Library/BootMaintenanceManagerUiLib/UpdatePage.c:536:27: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘ConsoleCheck’
edk2-20240813-build/edk2-b158dad150bf/MdeModulePkg/Library/BootMaintenanceManagerUiLib/UpdatePage.c:489:3: note: in expansion of macro ‘ASSERT’
#  534|         }

#  535|       } else if (Index < MAX_MENU_NUMBER) {

#  536|->       ConsoleCheck[Index] = FALSE;

#  537|       }

#  538|   


Error: GCC_ANALYZER_WARNING (CWE-476): [#def175]
edk2-20240813-build/edk2-b158dad150bf/MdeModulePkg/Library/BootMaintenanceManagerUiLib/UpdatePage.c: scope_hint: In function ‘UpdateOrderPage’
edk2-20240813-build/edk2-b158dad150bf/MdeModulePkg/Library/BootMaintenanceManagerUiLib/UpdatePage.c:628:70: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘OptionOrder’
edk2-20240813-build/edk2-b158dad150bf/MdeModulePkg/Library/BootMaintenanceManagerUiLib/UpdatePage.c:622:3: note: in expansion of macro ‘ASSERT’
#  626|   

#  627|     NewMenuEntry = NULL;

#  628|->   for (OptionIndex = 0; (OptionIndex < MAX_MENU_NUMBER && OptionOrder[OptionIndex] != 0); OptionIndex++) {

#  629|       BootOptionFound = FALSE;

#  630|       for (Index = 0; Index < OptionMenu->MenuNumber; Index++) {


Error: GCC_ANALYZER_WARNING (CWE-457): [#def176]
edk2-20240813-build/edk2-b158dad150bf/MdeModulePkg/Library/LzmaCustomDecompressLib/Sdk/C/LzmaDec.c: scope_hint: In function ‘LzmaDec_DecodeToDic’
edk2-20240813-build/edk2-b158dad150bf/MdeModulePkg/Library/LzmaCustomDecompressLib/Sdk/C/LzmaDec.c:874:26: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value ‘*p.tempBuf[1]’
edk2-20240813-build/edk2-b158dad150bf/MdeModulePkg/Library/LzmaCustomDecompressLib/Sdk/C/LzmaDec.c:11: included_from: Included from here.
edk2-20240813-build/edk2-b158dad150bf/MdeModulePkg/Library/LzmaCustomDecompressLib/Sdk/C/LzmaDec.c:1227:3: note: in expansion of macro ‘LzmaDec_Construct’
edk2-20240813-build/edk2-b158dad150bf/MdeModulePkg/Library/LzmaCustomDecompressLib/Sdk/C/LzmaDec.h:7: included_from: Included from here.
edk2-20240813-build/edk2-b158dad150bf/MdeModulePkg/Library/LzmaCustomDecompressLib/Sdk/C/7zTypes.h:65:39: note: in definition of macro ‘RINOK’
edk2-20240813-build/edk2-b158dad150bf/MdeModulePkg/Library/LzmaCustomDecompressLib/Sdk/C/LzmaDec.c:1155:3: note: in expansion of macro ‘RINOK’
edk2-20240813-build/edk2-b158dad150bf/MdeModulePkg/Library/LzmaCustomDecompressLib/Sdk/C/7zTypes.h:65:39: note: in definition of macro ‘RINOK’
edk2-20240813-build/edk2-b158dad150bf/MdeModulePkg/Library/LzmaCustomDecompressLib/Sdk/C/7zTypes.h:65:39: note: in definition of macro ‘RINOK’
edk2-20240813-build/edk2-b158dad150bf/MdeModulePkg/Library/LzmaCustomDecompressLib/Sdk/C/7zTypes.h:65:39: note: in definition of macro ‘RINOK’
edk2-20240813-build/edk2-b158dad150bf/MdeModulePkg/Library/LzmaCustomDecompressLib/Sdk/C/LzmaDec.c:1156:3: note: in expansion of macro ‘RINOK’
edk2-20240813-build/edk2-b158dad150bf/MdeModulePkg/Library/LzmaCustomDecompressLib/Sdk/C/7zTypes.h:65:39: note: in definition of macro ‘RINOK’
edk2-20240813-build/edk2-b158dad150bf/MdeModulePkg/Library/LzmaCustomDecompressLib/Sdk/C/LzmaDec.c:1228:3: note: in expansion of macro ‘RINOK’
#  872|   

#  873|       p->code =

#  874|->       ((UInt32)p->tempBuf[1] << 24)

#  875|         | ((UInt32)p->tempBuf[2] << 16)

#  876|         | ((UInt32)p->tempBuf[3] << 8)


Error: GCC_ANALYZER_WARNING (CWE-476): [#def177]
edk2-20240813-build/edk2-b158dad150bf/MdeModulePkg/Library/SmmLockBoxLib/SmmLockBoxMmLib.c: scope_hint: In function ‘InternalFindLockBoxByGuid’
edk2-20240813-build/edk2-b158dad150bf/MdeModulePkg/Library/SmmLockBoxLib/SmmLockBoxMmLib.c:385:13: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘LockBoxQueue’
#  383|     ASSERT (LockBoxQueue != NULL);

#  384|   

#  385|->   for (Link = LockBoxQueue->ForwardLink;

#  386|          Link != LockBoxQueue;

#  387|          Link = Link->ForwardLink)


Error: GCC_ANALYZER_WARNING (CWE-476): [#def178]
edk2-20240813-build/edk2-b158dad150bf/MdeModulePkg/Library/SmmLockBoxLib/SmmLockBoxMmLib.c: scope_hint: In function ‘RestoreAllLockBoxInPlace’
edk2-20240813-build/edk2-b158dad150bf/MdeModulePkg/Library/SmmLockBoxLib/SmmLockBoxMmLib.c:856:13: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘LockBoxQueue’
#  854|     // Restore all, Buffer and Length MUST be NULL

#  855|     //

#  856|->   for (Link = LockBoxQueue->ForwardLink;

#  857|          Link != LockBoxQueue;

#  858|          Link = Link->ForwardLink)


Error: GCC_ANALYZER_WARNING (CWE-476): [#def179]
edk2-20240813-build/edk2-b158dad150bf/MdeModulePkg/Library/SmmLockBoxLib/SmmLockBoxPeiLib.c: scope_hint: In function ‘InternalRestoreLockBoxFromSmram’
edk2-20240813-build/edk2-b158dad150bf/MdeModulePkg/Library/SmmLockBoxLib/SmmLockBoxPeiLib.c:276:61: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘SmmLockBoxContext’
#  274|     //

#  275|     SmmLockBoxContext = InternalGetSmmLockBoxContext ();

#  276|->   LockBoxQueue      = (LIST_ENTRY *)(UINTN)SmmLockBoxContext->LockBoxDataAddress;

#  277|   

#  278|     //


Error: GCC_ANALYZER_WARNING (CWE-476): [#def180]
edk2-20240813-build/edk2-b158dad150bf/MdeModulePkg/Library/SmmLockBoxLib/SmmLockBoxPeiLib.c: scope_hint: In function ‘InternalRestoreAllLockBoxInPlaceFromSmram’
edk2-20240813-build/edk2-b158dad150bf/MdeModulePkg/Library/SmmLockBoxLib/SmmLockBoxPeiLib.c:379:61: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘SmmLockBoxContext’
#  377|     //

#  378|     SmmLockBoxContext = InternalGetSmmLockBoxContext ();

#  379|->   LockBoxQueue      = (LIST_ENTRY *)(UINTN)SmmLockBoxContext->LockBoxDataAddress;

#  380|   

#  381|     //


Error: GCC_ANALYZER_WARNING (CWE-674): [#def181]
edk2-20240813-build/edk2-b158dad150bf/MdeModulePkg/Library/UefiBootManagerLib/BmHotkey.c: scope_hint: In function ‘BmGenerateKeyShiftState’
edk2-20240813-build/edk2-b158dad150bf/MdeModulePkg/Library/UefiBootManagerLib/BmHotkey.c:602:9: warning[-Wanalyzer-infinite-recursion]: infinite recursion
#  600|       case 0:

#  601|         if (KeyOption->KeyData.Options.ShiftPressed) {

#  602|->         BmGenerateKeyShiftState (Depth + 1, KeyOption, KeyShiftState | EFI_RIGHT_SHIFT_PRESSED, KeyShiftStates, KeyShiftStateCount);

#  603|           BmGenerateKeyShiftState (Depth + 1, KeyOption, KeyShiftState | EFI_LEFT_SHIFT_PRESSED, KeyShiftStates, KeyShiftStateCount);

#  604|         } else {


Error: GCC_ANALYZER_WARNING (CWE-476): [#def182]
edk2-20240813-build/edk2-b158dad150bf/MdeModulePkg/Universal/Acpi/AcpiTableDxe/AmlNamespace.c: scope_hint: In function ‘AmlFindNodeInThis’
edk2-20240813-build/edk2-b158dad150bf/MdeModulePkg/Universal/Acpi/AcpiTableDxe/AmlNamespace.c:83:15: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘AmlParentNodeList’
#   81|   

#   82|     StartLink   = &AmlParentNodeList->Children;

#   83|->   CurrentLink = StartLink->ForwardLink;

#   84|   

#   85|     while (CurrentLink != StartLink) {


Error: GCC_ANALYZER_WARNING (CWE-476): [#def183]
edk2-20240813-build/edk2-b158dad150bf/MdeModulePkg/Universal/Acpi/AcpiTableDxe/AmlNamespace.c: scope_hint: In function ‘AmlFindNodeInTheTree’
edk2-20240813-build/edk2-b158dad150bf/MdeModulePkg/Universal/Acpi/AcpiTableDxe/AmlNamespace.c:151:29: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘AmlCurrentNodeList’
#  149|       AmlCurrentNodeList = AmlParentNodeList;

#  150|       do {

#  151|->       if (AmlCurrentNodeList->Parent != NULL) {

#  152|           AmlCurrentNodeList = AmlCurrentNodeList->Parent;

#  153|         } else {


Error: GCC_ANALYZER_WARNING (CWE-457): [#def184]
edk2-20240813-build/edk2-b158dad150bf/MdeModulePkg/Universal/Disk/UdfDxe/FileSystemOperations.c: scope_hint: In function ‘GetFileEntryData’
edk2-20240813-build/edk2-b158dad150bf/MdeModulePkg/Universal/Disk/UdfDxe/FileSystemOperations.c:569:8: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value ‘*Length’
#  567|     }

#  568|   

#  569|->   if ((*Length > FileEntrySize) ||

#  570|         ((UINTN)FileEntryData > (UINTN)(*Data)) ||

#  571|         ((UINTN)(*Data) - (UINTN)FileEntryData > FileEntrySize - *Length))


Error: GCC_ANALYZER_WARNING (CWE-457): [#def185]
edk2-20240813-build/edk2-b158dad150bf/MdeModulePkg/Universal/Disk/UdfDxe/FileSystemOperations.c: scope_hint: In function ‘GetAdsInformation’
edk2-20240813-build/edk2-b158dad150bf/MdeModulePkg/Universal/Disk/UdfDxe/FileSystemOperations.c:628:8: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value ‘*Length’
#  626|     }

#  627|   

#  628|->   if ((*Length > FileEntrySize) ||

#  629|         ((UINTN)FileEntryData > (UINTN)(*AdsData)) ||

#  630|         ((UINTN)(*AdsData) - (UINTN)FileEntryData > FileEntrySize - *Length))


Error: GCC_ANALYZER_WARNING (CWE-476): [#def186]
edk2-20240813-build/edk2-b158dad150bf/MdeModulePkg/Universal/Disk/UdfDxe/FileSystemOperations.c: scope_hint: In function ‘GetShortAdFromAds’
edk2-20240813-build/edk2-b158dad150bf/MdeModulePkg/Universal/Disk/UdfDxe/Udf.h:102:67: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘ShortAd’
edk2-20240813-build/edk2-b158dad150bf/MdeModulePkg/Universal/Disk/UdfDxe/FileSystemOperations.c:733:19: note: in expansion of macro ‘GET_EXTENT_FLAGS’
edk2-20240813-build/edk2-b158dad150bf/MdeModulePkg/Universal/Disk/UdfDxe/FileSystemOperations.c:733:19: note: in expansion of macro ‘GET_EXTENT_FLAGS’
#  100|   #define GET_EXTENT_FLAGS(_RecFlags, _Ad) \

#  101|     ((_RecFlags) == ShortAdsSequence ? \

#  102|->    ((UDF_EXTENT_FLAGS)((((UDF_SHORT_ALLOCATION_DESCRIPTOR *)(_Ad))->ExtentLength >> \

#  103|               30) & 0x3)) : \

#  104|      ((UDF_EXTENT_FLAGS)((((UDF_LONG_ALLOCATION_DESCRIPTOR *)(_Ad))->ExtentLength >> \


Error: GCC_ANALYZER_WARNING (CWE-476): [#def187]
edk2-20240813-build/edk2-b158dad150bf/MdeModulePkg/Universal/Disk/UdfDxe/FileSystemOperations.c:10: included_from: Included from here.
edk2-20240813-build/edk2-b158dad150bf/MdeModulePkg/Universal/Disk/UdfDxe/FileSystemOperations.c: scope_hint: In function ‘GetLongAdFromAds’
edk2-20240813-build/edk2-b158dad150bf/MdeModulePkg/Universal/Disk/UdfDxe/Udf.h:104:66: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘LongAd’
edk2-20240813-build/edk2-b158dad150bf/MdeModulePkg/Universal/Disk/UdfDxe/FileSystemOperations.c:676:19: note: in expansion of macro ‘GET_EXTENT_FLAGS’
edk2-20240813-build/edk2-b158dad150bf/MdeModulePkg/Universal/Disk/UdfDxe/FileSystemOperations.c:676:19: note: in expansion of macro ‘GET_EXTENT_FLAGS’
#  102|      ((UDF_EXTENT_FLAGS)((((UDF_SHORT_ALLOCATION_DESCRIPTOR *)(_Ad))->ExtentLength >> \

#  103|               30) & 0x3)) : \

#  104|->    ((UDF_EXTENT_FLAGS)((((UDF_LONG_ALLOCATION_DESCRIPTOR *)(_Ad))->ExtentLength >> \

#  105|               30) & 0x3)))

#  106|   


Error: GCC_ANALYZER_WARNING (CWE-476): [#def188]
edk2-20240813-build/edk2-b158dad150bf/MdeModulePkg/Universal/DisplayEngineDxe/InputHandler.c: scope_hint: In function ‘GetSelectionInputPopUp’
edk2-20240813-build/edk2-b158dad150bf/MdeModulePkg/Universal/DisplayEngineDxe/InputHandler.c:1718:54: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘CurrentOption’
edk2-20240813-build/edk2-b158dad150bf/MdeModulePkg/Universal/DisplayEngineDxe/FormDisplay.h:13: included_from: Included from here.
edk2-20240813-build/edk2-b158dad150bf/MdeModulePkg/Universal/DisplayEngineDxe/InputHandler.c:10: included_from: Included from here.
edk2-20240813-build/edk2-b158dad150bf/MdeModulePkg/Universal/DisplayEngineDxe/InputHandler.c:1717:11: note: in expansion of macro ‘ASSERT’
# 1716|           } else {

# 1717|             ASSERT (CurrentOption != NULL);

# 1718|->           gUserInput->InputValue.Type = CurrentOption->OptionOpCode->Type;

# 1719|             if (IsValuesEqual (&Question->CurrentValue.Value, &CurrentOption->OptionOpCode->Value, gUserInput->InputValue.Type)) {

# 1720|               return EFI_DEVICE_ERROR;


Error: GCC_ANALYZER_WARNING (CWE-476): [#def189]
edk2-20240813-build/edk2-b158dad150bf/MdeModulePkg/Universal/HiiDatabaseDxe/Font.c: scope_hint: In function ‘HiiStringToImage.part.0’
edk2-20240813-build/edk2-b158dad150bf/MdeModulePkg/Universal/HiiDatabaseDxe/Font.c:1770:16: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘StringInfoOut’
edk2-20240813-build/edk2-b158dad150bf/MdeModulePkg/Universal/HiiDatabaseDxe/HiiDatabase.h:32: included_from: Included from here.
edk2-20240813-build/edk2-b158dad150bf/MdeModulePkg/Universal/HiiDatabaseDxe/Font.c:10: included_from: Included from here.
edk2-20240813-build/edk2-b158dad150bf/MdeModulePkg/Universal/HiiDatabaseDxe/Font.c:1766:5: note: in expansion of macro ‘ASSERT’
# 1768|       Height     = SystemDefault->FontInfo.FontSize;

# 1769|       BaseLine   = SystemDefault->FontInfo.FontSize;

# 1770|->     Foreground = SystemDefault->ForegroundColor;

# 1771|       Background = SystemDefault->BackgroundColor;

# 1772|     } else {


Error: GCC_ANALYZER_WARNING (CWE-476): [#def190]
edk2-20240813-build/edk2-b158dad150bf/MdeModulePkg/Universal/SetupBrowserDxe/Expression.c: scope_hint: In function ‘IfrToUint’
edk2-20240813-build/edk2-b158dad150bf/MdeModulePkg/Universal/SetupBrowserDxe/Expression.c:1272:25: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘0’
edk2-20240813-build/edk2-b158dad150bf/MdeModulePkg/Universal/SetupBrowserDxe/Setup.h:36: included_from: Included from here.
edk2-20240813-build/edk2-b158dad150bf/MdeModulePkg/Universal/SetupBrowserDxe/Expression.c:9: included_from: Included from here.
edk2-20240813-build/edk2-b158dad150bf/MdeModulePkg/Universal/SetupBrowserDxe/Expression.c:3748:3: note: in expansion of macro ‘ASSERT’
edk2-20240813-build/edk2-b158dad150bf/MdeModulePkg/Universal/SetupBrowserDxe/Setup.h:214:41: note: in expansion of macro ‘CR’
edk2-20240813-build/edk2-b158dad150bf/MdeModulePkg/Universal/SetupBrowserDxe/Expression.c:2580:14: note: in expansion of macro ‘EXPRESSION_OPCODE_FROM_LINK’
edk2-20240813-build/edk2-b158dad150bf/MdeModulePkg/Universal/SetupBrowserDxe/Setup.h:235:39: note: in expansion of macro ‘CR’
edk2-20240813-build/edk2-b158dad150bf/MdeModulePkg/Universal/SetupBrowserDxe/Expression.c:905:18: note: in expansion of macro ‘FORM_EXPRESSION_FROM_LINK’
edk2-20240813-build/edk2-b158dad150bf/MdeModulePkg/Universal/SetupBrowserDxe/Setup.h:214:41: note: in expansion of macro ‘CR’
edk2-20240813-build/edk2-b158dad150bf/MdeModulePkg/Universal/SetupBrowserDxe/Expression.c:2580:14: note: in expansion of macro ‘EXPRESSION_OPCODE_FROM_LINK’
edk2-20240813-build/edk2-b158dad150bf/MdeModulePkg/Universal/SetupBrowserDxe/Setup.h:235:39: note: in expansion of macro ‘CR’
edk2-20240813-build/edk2-b158dad150bf/MdeModulePkg/Universal/SetupBrowserDxe/Expression.c:905:18: note: in expansion of macro ‘FORM_EXPRESSION_FROM_LINK’
edk2-20240813-build/edk2-b158dad150bf/MdeModulePkg/Universal/SetupBrowserDxe/Setup.h:214:41: note: in expansion of macro ‘CR’
edk2-20240813-build/edk2-b158dad150bf/MdeModulePkg/Universal/SetupBrowserDxe/Expression.c:2580:14: note: in expansion of macro ‘EXPRESSION_OPCODE_FROM_LINK’
edk2-20240813-build/edk2-b158dad150bf/MdeModulePkg/Universal/SetupBrowserDxe/Expression.c:1271:5: note: in expansion of macro ‘ASSERT’
# 1270|   

# 1271|       ASSERT (GetBufferForValue (&Value) != NULL);

# 1272|->     Result->Value.u64 = *(UINT64 *)GetBufferForValue (&Value);

# 1273|   

# 1274|       if (Value.Type == EFI_IFR_TYPE_BUFFER) {


Error: GCC_ANALYZER_WARNING (CWE-476): [#def191]
edk2-20240813-build/edk2-b158dad150bf/MdeModulePkg/Universal/SetupBrowserDxe/IfrParse.c: scope_hint: In function ‘InitializeRequestElement’
edk2-20240813-build/edk2-b158dad150bf/MdeModulePkg/Universal/SetupBrowserDxe/IfrParse.c:621:31: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘FormsetStorage’
edk2-20240813-build/edk2-b158dad150bf/MdeModulePkg/Universal/SetupBrowserDxe/Setup.h:36: included_from: Included from here.
edk2-20240813-build/edk2-b158dad150bf/MdeModulePkg/Universal/SetupBrowserDxe/IfrParse.c:9: included_from: Included from here.
edk2-20240813-build/edk2-b158dad150bf/MdeModulePkg/Universal/SetupBrowserDxe/IfrParse.c:41:5: note: in expansion of macro ‘ASSERT’
#  619|     FormsetStorage = GetFstStgFromVarId (FormSet, Question->VarStoreId);

#  620|     ASSERT (FormsetStorage != NULL);

#  621|->   StringSize = (FormsetStorage->ConfigRequest != NULL) ? StrSize (FormsetStorage->ConfigRequest) : sizeof (CHAR16);

#  622|     MaxLen     = StringSize / sizeof (CHAR16) + FormsetStorage->SpareStrLen;

#  623|   


Error: GCC_ANALYZER_WARNING (CWE-476): [#def192]
edk2-20240813-build/edk2-b158dad150bf/MdeModulePkg/Universal/SetupBrowserDxe/IfrParse.c: scope_hint: In function ‘ParseOpCodes’
edk2-20240813-build/edk2-b158dad150bf/MdeModulePkg/Universal/SetupBrowserDxe/IfrParse.c:1377:57: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘ParentStatement’
# 1375|           case EFI_IFR_THIS_OP:

# 1376|             ASSERT (ParentStatement != NULL);

# 1377|->           ExpressionOpCode->QuestionId = ParentStatement->QuestionId;

# 1378|             break;

# 1379|   


Error: GCC_ANALYZER_WARNING (CWE-476): [#def193]
edk2-20240813-build/edk2-b158dad150bf/MdeModulePkg/Universal/SetupBrowserDxe/IfrParse.c:2153:29: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘ParentStatement’
# 2151|         case EFI_IFR_ONE_OF_OPTION_OP:

# 2152|           ASSERT (ParentStatement != NULL);

# 2153|->         if ((ParentStatement->Operand == EFI_IFR_ORDERED_LIST_OP) && ((((EFI_IFR_ONE_OF_OPTION *)OpCodeData)->Flags & (EFI_IFR_OPTION_DEFAULT | EFI_IFR_OPTION_DEFAULT_MFG)) != 0)) {

# 2154|             //

# 2155|             // It's keep the default value for ordered list opcode.


Error: GCC_ANALYZER_WARNING (CWE-476): [#def194]
edk2-20240813-build/edk2-b158dad150bf/MdeModulePkg/Universal/SetupBrowserDxe/IfrParse.c:2407:44: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘ParentStatement’
edk2-20240813-build/edk2-b158dad150bf/MdeModulePkg/Universal/SetupBrowserDxe/IfrParse.c:2406:11: note: in expansion of macro ‘ASSERT’
# 2405|             //

# 2406|             ASSERT (ParentStatement != NULL);

# 2407|->           ParentStatement->ValueExpression = CurrentExpression;

# 2408|           }

# 2409|   


Error: GCC_ANALYZER_WARNING (CWE-476): [#def195]
edk2-20240813-build/edk2-b158dad150bf/MdeModulePkg/Universal/SetupBrowserDxe/IfrParse.c:2448:41: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘ParentStatement’
# 2446|           //

# 2447|           ASSERT (ParentStatement != NULL);

# 2448|->         ParentStatement->ReadExpression = CurrentExpression;

# 2449|   

# 2450|           //


Error: GCC_ANALYZER_WARNING (CWE-476): [#def196]
edk2-20240813-build/edk2-b158dad150bf/MdeModulePkg/Universal/SetupBrowserDxe/IfrParse.c:2471:42: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘ParentStatement’
# 2469|           //

# 2470|           ASSERT (ParentStatement != NULL);

# 2471|->         ParentStatement->WriteExpression = CurrentExpression;

# 2472|   

# 2473|           //


Error: GCC_ANALYZER_WARNING (CWE-476): [#def197]
edk2-20240813-build/edk2-b158dad150bf/MdeModulePkg/Universal/SetupBrowserDxe/IfrParse.c:2529:42: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘ParentStatement’
# 2527|         case EFI_IFR_REFRESH_OP:

# 2528|           ASSERT (ParentStatement != NULL);

# 2529|->         ParentStatement->RefreshInterval = ((EFI_IFR_REFRESH *)OpCodeData)->RefreshInterval;

# 2530|           break;

# 2531|   


Error: GCC_ANALYZER_WARNING (CWE-476): [#def198]
edk2-20240813-build/edk2-b158dad150bf/MdeModulePkg/Universal/SetupBrowserDxe/IfrParse.c:2562:32: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘CurrentForm’
# 2560|         case EFI_IFR_MODAL_TAG_OP:

# 2561|           ASSERT (CurrentForm != NULL);

# 2562|->         CurrentForm->ModalForm = TRUE;

# 2563|           break;

# 2564|   


Error: GCC_ANALYZER_WARNING (CWE-476): [#def199]
edk2-20240813-build/edk2-b158dad150bf/MdeModulePkg/Universal/SetupBrowserDxe/IfrParse.c:2578:33: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘CurrentForm’
# 2576|             case EFI_IFR_FORM_MAP_OP:

# 2577|               ASSERT (CurrentForm != NULL);

# 2578|->             CurrentForm->Locked = TRUE;

# 2579|               break;

# 2580|   


Error: GCC_ANALYZER_WARNING (CWE-476): [#def200]
edk2-20240813-build/edk2-b158dad150bf/MdeModulePkg/Universal/SetupBrowserDxe/IfrParse.c:2583:37: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘ParentStatement’
# 2581|             default:

# 2582|               ASSERT (ParentStatement != NULL);

# 2583|->             ParentStatement->Locked = TRUE;

# 2584|           }

# 2585|   


Error: GCC_ANALYZER_WARNING (CWE-476): [#def201]
edk2-20240813-build/edk2-b158dad150bf/MdeModulePkg/Universal/SetupBrowserDxe/IfrParse.c:2738:41: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘CurrentStatement’
# 2736|   

# 2737|       if (IsStatementOpCode (Operand)) {

# 2738|->       CurrentStatement->ParentStatement = ParentStatement;

# 2739|         if (Scope != 0) {

# 2740|           //


Error: GCC_ANALYZER_WARNING (CWE-476): [#def202]
edk2-20240813-build/edk2-b158dad150bf/MdeModulePkg/Universal/SetupBrowserDxe/Presentation.c: scope_hint: In function ‘ProcessUserInput’
edk2-20240813-build/edk2-b158dad150bf/MdeModulePkg/Universal/SetupBrowserDxe/Presentation.c:1591:59: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘Statement’
edk2-20240813-build/edk2-b158dad150bf/MdeModulePkg/Universal/SetupBrowserDxe/Setup.h:36: included_from: Included from here.
edk2-20240813-build/edk2-b158dad150bf/MdeModulePkg/Universal/SetupBrowserDxe/Presentation.c:10: included_from: Included from here.
edk2-20240813-build/edk2-b158dad150bf/MdeModulePkg/Universal/SetupBrowserDxe/Setup.h:417:41: note: in expansion of macro ‘CR’
edk2-20240813-build/edk2-b158dad150bf/MdeModulePkg/Universal/SetupBrowserDxe/Presentation.c:2447:27: note: in expansion of macro ‘FORM_BROWSER_FORM_FROM_LINK’
edk2-20240813-build/edk2-b158dad150bf/MdePkg/Include/Library/DebugLib.h:625:15: note: in expansion of macro ‘_ASSERT’
edk2-20240813-build/edk2-b158dad150bf/MdeModulePkg/Universal/SetupBrowserDxe/Setup.h:417:41: note: in expansion of macro ‘CR’
edk2-20240813-build/edk2-b158dad150bf/MdeModulePkg/Universal/SetupBrowserDxe/Presentation.c:2447:27: note: in expansion of macro ‘FORM_BROWSER_FORM_FROM_LINK’
edk2-20240813-build/edk2-b158dad150bf/MdeModulePkg/Universal/SetupBrowserDxe/Setup.h:469:44: note: in expansion of macro ‘CR’
edk2-20240813-build/edk2-b158dad150bf/MdeModulePkg/Universal/SetupBrowserDxe/Presentation.c:697:24: note: in expansion of macro ‘FORM_BROWSER_FORMSET_FROM_LINK’
# 1589|       // show it as the highlight question.

# 1590|       //

# 1591|->     gCurrentSelection->CurrentMenu->QuestionId = Statement->QuestionId;

# 1592|       //

# 1593|       // For statement like text, actio, it not has question id.


Error: GCC_ANALYZER_WARNING (CWE-476): [#def203]
edk2-20240813-build/edk2-b158dad150bf/MdeModulePkg/Universal/SetupBrowserDxe/Presentation.c:1612:22: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘Statement’
edk2-20240813-build/edk2-b158dad150bf/MdeModulePkg/Universal/SetupBrowserDxe/Setup.h:417:41: note: in expansion of macro ‘CR’
edk2-20240813-build/edk2-b158dad150bf/MdeModulePkg/Universal/SetupBrowserDxe/Presentation.c:2447:27: note: in expansion of macro ‘FORM_BROWSER_FORM_FROM_LINK’
edk2-20240813-build/edk2-b158dad150bf/MdePkg/Include/Library/DebugLib.h:625:15: note: in expansion of macro ‘_ASSERT’
edk2-20240813-build/edk2-b158dad150bf/MdeModulePkg/Universal/SetupBrowserDxe/Setup.h:417:41: note: in expansion of macro ‘CR’
edk2-20240813-build/edk2-b158dad150bf/MdeModulePkg/Universal/SetupBrowserDxe/Presentation.c:2447:27: note: in expansion of macro ‘FORM_BROWSER_FORM_FROM_LINK’
edk2-20240813-build/edk2-b158dad150bf/MdeModulePkg/Universal/SetupBrowserDxe/Setup.h:469:44: note: in expansion of macro ‘CR’
edk2-20240813-build/edk2-b158dad150bf/MdeModulePkg/Universal/SetupBrowserDxe/Presentation.c:697:24: note: in expansion of macro ‘FORM_BROWSER_FORMSET_FROM_LINK’
edk2-20240813-build/edk2-b158dad150bf/MdeModulePkg/Universal/SetupBrowserDxe/Presentation.c:1610:5: note: in expansion of macro ‘ASSERT’
# 1610|       ASSERT (Statement != NULL);

# 1611|       gCurrentSelection->Statement = Statement;

# 1612|->     switch (Statement->Operand) {

# 1613|         case EFI_IFR_REF_OP:

# 1614|           Status = ProcessGotoOpCode (Statement, gCurrentSelection);


Error: GCC_ANALYZER_WARNING (CWE-476): [#def204]
edk2-20240813-build/edk2-b158dad150bf/MdeModulePkg/Universal/SetupBrowserDxe/Presentation.c: scope_hint: In function ‘DisplayForm’
edk2-20240813-build/edk2-b158dad150bf/MdeModulePkg/Universal/SetupBrowserDxe/Presentation.c:1732:48: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘CurrentMenu’
edk2-20240813-build/edk2-b158dad150bf/MdeModulePkg/Universal/SetupBrowserDxe/Setup.h:417:41: note: in expansion of macro ‘CR’
edk2-20240813-build/edk2-b158dad150bf/MdeModulePkg/Universal/SetupBrowserDxe/Presentation.c:2447:27: note: in expansion of macro ‘FORM_BROWSER_FORM_FROM_LINK’
edk2-20240813-build/edk2-b158dad150bf/MdePkg/Include/Library/DebugLib.h:625:15: note: in expansion of macro ‘_ASSERT’
edk2-20240813-build/edk2-b158dad150bf/MdeModulePkg/Universal/SetupBrowserDxe/Setup.h:417:41: note: in expansion of macro ‘CR’
edk2-20240813-build/edk2-b158dad150bf/MdeModulePkg/Universal/SetupBrowserDxe/Presentation.c:2447:27: note: in expansion of macro ‘FORM_BROWSER_FORM_FROM_LINK’
edk2-20240813-build/edk2-b158dad150bf/MdeModulePkg/Universal/SetupBrowserDxe/Presentation.c:1718:5: note: in expansion of macro ‘ASSERT’
edk2-20240813-build/edk2-b158dad150bf/MdePkg/Include/Library/DebugLib.h:400:11: note: in expansion of macro ‘_ASSERT’
edk2-20240813-build/edk2-b158dad150bf/MdeModulePkg/Universal/SetupBrowserDxe/Presentation.c:1718:5: note: in expansion of macro ‘ASSERT’
# 1730|       // Highlight not specified, fetch it from cached menu

# 1731|       //

# 1732|->     gCurrentSelection->QuestionId = CurrentMenu->QuestionId;

# 1733|     }

# 1734|   


Error: GCC_ANALYZER_WARNING (CWE-457): [#def205]
edk2-20240813-build/edk2-b158dad150bf/MdeModulePkg/Universal/Variable/RuntimeDxe/Variable.c: scope_hint: In function ‘UpdateVariable’
edk2-20240813-build/edk2-b158dad150bf/MdeModulePkg/Universal/Variable/RuntimeDxe/Variable.c:1740:21: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value ‘*CacheVariable.CurrPtr’
edk2-20240813-build/edk2-b158dad150bf/MdeModulePkg/Universal/Variable/RuntimeDxe/Variable.h:25: included_from: Included from here.
edk2-20240813-build/edk2-b158dad150bf/MdeModulePkg/Universal/Variable/RuntimeDxe/Variable.c:28: included_from: Included from here.
edk2-20240813-build/edk2-b158dad150bf/MdeModulePkg/Universal/Variable/RuntimeDxe/Variable.c:3320:7: note: in expansion of macro ‘ASSERT’
edk2-20240813-build/edk2-b158dad150bf/MdeModulePkg/Universal/Variable/RuntimeDxe/Variable.c:3320:7: note: in expansion of macro ‘ASSERT’
# 1738|     // If yes, let CacheVariable points to the variable in NV variable cache.

# 1739|     //

# 1740|->   if ((CacheVariable->CurrPtr != NULL) &&

# 1741|         (mVariableModuleGlobal->VariableGlobal.HobVariableBase != 0) &&

# 1742|         (CacheVariable->StartPtr == GetStartPointer ((VARIABLE_STORE_HEADER *)(UINTN)mVariableModuleGlobal->VariableGlobal.HobVariableBase))


Error: GCC_ANALYZER_WARNING (CWE-457): [#def206]
edk2-20240813-build/edk2-b158dad150bf/MdePkg/Include/Uefi/UefiBaseType.h:16: included_from: Included from here.
edk2-20240813-build/edk2-b158dad150bf/MdePkg/Include/Uefi.h:17: included_from: Included from here.
edk2-20240813-build/edk2-b158dad150bf/Build/OvmfX64/DEBUG_GCC5/X64/ShellPkg/Library/UefiShellDebug1CommandsLib/UefiShellDebug1CommandsLib/DEBUG/AutoGen.h:16: included_from: Included from here.
<command-line>: included_from: Included from here.
edk2-20240813-build/edk2-b158dad150bf/ShellPkg/Library/UefiShellDebug1CommandsLib/Dmem.c: scope_hint: In function ‘DisplayConformanceProfiles’
edk2-20240813-build/edk2-b158dad150bf/MdePkg/Include/Base.h:1061:37: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value ‘Status’
edk2-20240813-build/edk2-b158dad150bf/MdePkg/Include/Uefi/UefiBaseType.h:161:23: note: in expansion of macro ‘RETURN_ERROR’
edk2-20240813-build/edk2-b158dad150bf/ShellPkg/Library/UefiShellDebug1CommandsLib/Dmem.c:325:9: note: in expansion of macro ‘EFI_ERROR’
edk2-20240813-build/edk2-b158dad150bf/MdePkg/Include/Uefi/UefiBaseType.h:161:23: note: in expansion of macro ‘RETURN_ERROR’
edk2-20240813-build/edk2-b158dad150bf/ShellPkg/Library/UefiShellDebug1CommandsLib/Dmem.c:325:9: note: in expansion of macro ‘EFI_ERROR’
edk2-20240813-build/edk2-b158dad150bf/MdePkg/Include/Uefi/UefiBaseType.h:161:23: note: in expansion of macro ‘RETURN_ERROR’
edk2-20240813-build/edk2-b158dad150bf/ShellPkg/Library/UefiShellDebug1CommandsLib/Dmem.c:325:9: note: in expansion of macro ‘EFI_ERROR’
# 1059|   

# 1060|   **/

# 1061|-> #define RETURN_ERROR(StatusCode)  (((INTN)(RETURN_STATUS)(StatusCode)) < 0)

# 1062|   

# 1063|   ///


Error: GCC_ANALYZER_WARNING (CWE-476): [#def207]
edk2-20240813-build/edk2-b158dad150bf/MdeModulePkg/Bus/Ata/AtaBusDxe/AtaBus.h:24: included_from: Included from here.
edk2-20240813-build/edk2-b158dad150bf/MdeModulePkg/Bus/Ata/AtaBusDxe/AtaBus.c:13: included_from: Included from here.
edk2-20240813-build/edk2-b158dad150bf/MdeModulePkg/Bus/Ata/AtaBusDxe/AtaBus.c: scope_hint: In function ‘UnregisterAtaDevice’
edk2-20240813-build/edk2-b158dad150bf/MdePkg/Include/Library/DebugLib.h:624:61: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘BlockIo2’
edk2-20240813-build/edk2-b158dad150bf/MdeModulePkg/Bus/Ata/AtaBusDxe/AtaBus.h:159:46: note: in expansion of macro ‘CR’
edk2-20240813-build/edk2-b158dad150bf/MdeModulePkg/Bus/Ata/AtaBusDxe/AtaBus.c:466:17: note: in expansion of macro ‘ATA_DEVICE_FROM_BLOCK_IO2’
edk2-20240813-build/edk2-b158dad150bf/MdeModulePkg/Bus/Ata/AtaBusDxe/AtaBus.c:465:5: note: in expansion of macro ‘ASSERT’
edk2-20240813-build/edk2-b158dad150bf/MdeModulePkg/Bus/Ata/AtaBusDxe/AtaBus.h:159:46: note: in expansion of macro ‘CR’
edk2-20240813-build/edk2-b158dad150bf/MdeModulePkg/Bus/Ata/AtaBusDxe/AtaBus.c:466:17: note: in expansion of macro ‘ATA_DEVICE_FROM_BLOCK_IO2’
edk2-20240813-build/edk2-b158dad150bf/MdePkg/Include/Uefi/UefiBaseType.h:16: included_from: Included from here.
edk2-20240813-build/edk2-b158dad150bf/MdePkg/Include/Uefi.h:17: included_from: Included from here.
edk2-20240813-build/edk2-b158dad150bf/Build/OvmfX64/DEBUG_GCC5/X64/MdeModulePkg/Bus/Ata/AtaBusDxe/AtaBusDxe/DEBUG/AutoGen.h:16: included_from: Included from here.
<command-line>: included_from: Included from here.
edk2-20240813-build/edk2-b158dad150bf/MdePkg/Include/Library/DebugLib.h:624:32: note: in expansion of macro ‘BASE_CR’
edk2-20240813-build/edk2-b158dad150bf/MdeModulePkg/Bus/Ata/AtaBusDxe/AtaBus.h:159:46: note: in expansion of macro ‘CR’
edk2-20240813-build/edk2-b158dad150bf/MdeModulePkg/Bus/Ata/AtaBusDxe/AtaBus.c:466:17: note: in expansion of macro ‘ATA_DEVICE_FROM_BLOCK_IO2’
edk2-20240813-build/edk2-b158dad150bf/MdePkg/Include/Library/DebugLib.h:624:32: note: in expansion of macro ‘BASE_CR’
edk2-20240813-build/edk2-b158dad150bf/MdeModulePkg/Bus/Ata/AtaBusDxe/AtaBus.h:159:46: note: in expansion of macro ‘CR’
edk2-20240813-build/edk2-b158dad150bf/MdeModulePkg/Bus/Ata/AtaBusDxe/AtaBus.c:466:17: note: in expansion of macro ‘ATA_DEVICE_FROM_BLOCK_IO2’
edk2-20240813-build/edk2-b158dad150bf/MdeModulePkg/Bus/Ata/AtaBusDxe/AtaBus.h:159:46: note: in expansion of macro ‘CR’
edk2-20240813-build/edk2-b158dad150bf/MdeModulePkg/Bus/Ata/AtaBusDxe/AtaBus.c:466:17: note: in expansion of macro ‘ATA_DEVICE_FROM_BLOCK_IO2’
#  622|   #if !defined (MDEPKG_NDEBUG)

#  623|   #define CR(Record, TYPE, Field, TestSignature)                                              \

#  624|->     (DebugAssertEnabled () && (BASE_CR (Record, TYPE, Field)->Signature != TestSignature)) ?  \

#  625|       (TYPE *) (_ASSERT (CR has Bad Signature), Record) :                                       \

#  626|       BASE_CR (Record, TYPE, Field)


Error: GCC_ANALYZER_WARNING (CWE-476): [#def208]
edk2-20240813-build/edk2-b158dad150bf/MdePkg/Library/BaseOrderedCollectionRedBlackTreeLib/BaseOrderedCollectionRedBlackTreeLib.c:20: included_from: Included from here.
edk2-20240813-build/edk2-b158dad150bf/MdePkg/Library/BaseOrderedCollectionRedBlackTreeLib/BaseOrderedCollectionRedBlackTreeLib.c: scope_hint: In function ‘OrderedCollectionDelete’
edk2-20240813-build/edk2-b158dad150bf/MdePkg/Library/BaseOrderedCollectionRedBlackTreeLib/BaseOrderedCollectionRedBlackTreeLib.c:1188:24: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘Sibling’
edk2-20240813-build/edk2-b158dad150bf/MdePkg/Include/Library/DebugLib.h:399:15: note: in definition of macro ‘ASSERT’
edk2-20240813-build/edk2-b158dad150bf/MdePkg/Library/BaseOrderedCollectionRedBlackTreeLib/BaseOrderedCollectionRedBlackTreeLib.c:1188:9: note: in expansion of macro ‘ASSERT’
edk2-20240813-build/edk2-b158dad150bf/MdePkg/Include/Library/DebugLib.h:399:15: note: in definition of macro ‘ASSERT’
edk2-20240813-build/edk2-b158dad150bf/MdePkg/Include/Library/DebugLib.h:399:15: note: in definition of macro ‘ASSERT’
# 1186|           // node.)

# 1187|           //

# 1188|->         ASSERT (Sibling->Color == RedBlackTreeBlack);

# 1189|           LeftNephew  = Sibling->Left;

# 1190|           RightNephew = Sibling->Right;


Error: GCC_ANALYZER_WARNING (CWE-476): [#def209]
edk2-20240813-build/edk2-b158dad150bf/MdePkg/Library/BaseOrderedCollectionRedBlackTreeLib/BaseOrderedCollectionRedBlackTreeLib.c:1189:21: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘Sibling’
edk2-20240813-build/edk2-b158dad150bf/MdePkg/Library/BaseOrderedCollectionRedBlackTreeLib/BaseOrderedCollectionRedBlackTreeLib.c:1188:9: note: in expansion of macro ‘ASSERT’
# 1187|           //

# 1188|           ASSERT (Sibling->Color == RedBlackTreeBlack);

# 1189|->         LeftNephew  = Sibling->Left;

# 1190|           RightNephew = Sibling->Right;

# 1191|           if (NodeIsNullOrBlack (LeftNephew) &&


Error: GCC_ANALYZER_WARNING (CWE-476): [#def210]
edk2-20240813-build/edk2-b158dad150bf/MdePkg/Library/BaseOrderedCollectionRedBlackTreeLib/BaseOrderedCollectionRedBlackTreeLib.c:1309:24: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘Sibling’
edk2-20240813-build/edk2-b158dad150bf/MdePkg/Include/Library/DebugLib.h:399:15: note: in definition of macro ‘ASSERT’
edk2-20240813-build/edk2-b158dad150bf/MdePkg/Library/BaseOrderedCollectionRedBlackTreeLib/BaseOrderedCollectionRedBlackTreeLib.c:1309:9: note: in expansion of macro ‘ASSERT’
edk2-20240813-build/edk2-b158dad150bf/MdePkg/Include/Library/DebugLib.h:399:15: note: in definition of macro ‘ASSERT’
edk2-20240813-build/edk2-b158dad150bf/MdePkg/Include/Library/DebugLib.h:399:15: note: in definition of macro ‘ASSERT’
# 1307|           }

# 1308|   

# 1309|->         ASSERT (Sibling->Color == RedBlackTreeBlack);

# 1310|           RightNephew = Sibling->Right;

# 1311|           LeftNephew  = Sibling->Left;


Error: GCC_ANALYZER_WARNING (CWE-476): [#def211]
edk2-20240813-build/edk2-b158dad150bf/MdePkg/Library/BaseOrderedCollectionRedBlackTreeLib/BaseOrderedCollectionRedBlackTreeLib.c:1310:21: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘Sibling’
edk2-20240813-build/edk2-b158dad150bf/MdePkg/Library/BaseOrderedCollectionRedBlackTreeLib/BaseOrderedCollectionRedBlackTreeLib.c:1309:9: note: in expansion of macro ‘ASSERT’
# 1308|   

# 1309|           ASSERT (Sibling->Color == RedBlackTreeBlack);

# 1310|->         RightNephew = Sibling->Right;

# 1311|           LeftNephew  = Sibling->Left;

# 1312|           if (NodeIsNullOrBlack (RightNephew) &&


Error: GCC_ANALYZER_WARNING (CWE-476): [#def212]
edk2-20240813-build/edk2-b158dad150bf/NetworkPkg/DnsDxe/DnsImpl.c: scope_hint: In function ‘ParseDnsResponse’
edk2-20240813-build/edk2-b158dad150bf/NetworkPkg/DnsDxe/DnsImpl.c:1304:23: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘Dns4TokenEntry’
edk2-20240813-build/edk2-b158dad150bf/NetworkPkg/DnsDxe/DnsImpl.h:24: included_from: Included from here.
edk2-20240813-build/edk2-b158dad150bf/NetworkPkg/DnsDxe/DnsImpl.c:10: included_from: Included from here.
edk2-20240813-build/edk2-b158dad150bf/NetworkPkg/DnsDxe/DnsImpl.c:1085:3: note: in expansion of macro ‘NET_LIST_FOR_EACH’
edk2-20240813-build/edk2-b158dad150bf/NetworkPkg/DnsDxe/DnsImpl.h:25: included_from: Included from here.
edk2-20240813-build/edk2-b158dad150bf/NetworkPkg/DnsDxe/DnsImpl.c:1276:5: note: in expansion of macro ‘ASSERT’
edk2-20240813-build/edk2-b158dad150bf/NetworkPkg/DnsDxe/DnsImpl.c:1302:5: note: in expansion of macro ‘ASSERT’
# 1302|       ASSERT (Dns4TokenEntry != NULL);

# 1303|   

# 1304|->     if (Dns4TokenEntry->GeneralLookUp) {

# 1305|         //

# 1306|         // It's the GeneralLookUp querying.


Error: GCC_ANALYZER_WARNING (CWE-476): [#def213]
edk2-20240813-build/edk2-b158dad150bf/NetworkPkg/DnsDxe/DnsImpl.c:1343:23: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘Dns6TokenEntry’
edk2-20240813-build/edk2-b158dad150bf/NetworkPkg/DnsDxe/DnsImpl.c:1085:3: note: in expansion of macro ‘NET_LIST_FOR_EACH’
edk2-20240813-build/edk2-b158dad150bf/NetworkPkg/DnsDxe/DnsImpl.c:1260:5: note: in expansion of macro ‘ASSERT’
edk2-20240813-build/edk2-b158dad150bf/NetworkPkg/DnsDxe/DnsImpl.c:1341:5: note: in expansion of macro ‘ASSERT’
# 1341|       ASSERT (Dns6TokenEntry != NULL);

# 1342|   

# 1343|->     if (Dns6TokenEntry->GeneralLookUp) {

# 1344|         //

# 1345|         // It's the GeneralLookUp querying.


Error: GCC_ANALYZER_WARNING (CWE-476): [#def214]
edk2-20240813-build/edk2-b158dad150bf/NetworkPkg/DnsDxe/DnsImpl.c:1434:73: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘Dns4TokenEntry’
edk2-20240813-build/edk2-b158dad150bf/NetworkPkg/DnsDxe/DnsImpl.c:1085:3: note: in expansion of macro ‘NET_LIST_FOR_EACH’
edk2-20240813-build/edk2-b158dad150bf/NetworkPkg/DnsDxe/DnsImpl.c:1276:5: note: in expansion of macro ‘ASSERT’
edk2-20240813-build/edk2-b158dad150bf/NetworkPkg/DnsDxe/DnsImpl.c:1341:5: note: in expansion of macro ‘ASSERT’
edk2-20240813-build/edk2-b158dad150bf/NetworkPkg/Include/Library/NetLib.h:220:32: note: in definition of macro ‘NTOHS’
# 1432|       // Check whether it's the GeneralLookUp querying.

# 1433|       //

# 1434|->     if ((Instance->Service->IpVersion == IP_VERSION_4) && Dns4TokenEntry->GeneralLookUp) {

# 1435|         Dns4RR     = Dns4TokenEntry->Token->RspData.GLookupData->RRList;

# 1436|         AnswerData = (UINT8 *)AnswerSection + sizeof (*AnswerSection);


Error: GCC_ANALYZER_WARNING (CWE-476): [#def215]
edk2-20240813-build/edk2-b158dad150bf/NetworkPkg/DnsDxe/DnsImpl.c:1462:80: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘Dns6TokenEntry’
edk2-20240813-build/edk2-b158dad150bf/NetworkPkg/DnsDxe/DnsImpl.c:1085:3: note: in expansion of macro ‘NET_LIST_FOR_EACH’
edk2-20240813-build/edk2-b158dad150bf/NetworkPkg/DnsDxe/DnsImpl.c:1260:5: note: in expansion of macro ‘ASSERT’
edk2-20240813-build/edk2-b158dad150bf/NetworkPkg/DnsDxe/DnsImpl.c:1302:5: note: in expansion of macro ‘ASSERT’
edk2-20240813-build/edk2-b158dad150bf/NetworkPkg/Include/Library/NetLib.h:220:32: note: in definition of macro ‘NTOHS’
# 1460|         RRCount++;

# 1461|         Status = EFI_SUCCESS;

# 1462|->     } else if ((Instance->Service->IpVersion == IP_VERSION_6) && Dns6TokenEntry->GeneralLookUp) {

# 1463|         Dns6RR     = Dns6TokenEntry->Token->RspData.GLookupData->RRList;

# 1464|         AnswerData = (UINT8 *)AnswerSection + sizeof (*AnswerSection);


Error: GCC_ANALYZER_WARNING (CWE-476): [#def216]
edk2-20240813-build/edk2-b158dad150bf/NetworkPkg/DnsDxe/DnsImpl.c:1507:38: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘Dns4TokenEntry’
edk2-20240813-build/edk2-b158dad150bf/NetworkPkg/DnsDxe/DnsImpl.c:1085:3: note: in expansion of macro ‘NET_LIST_FOR_EACH’
edk2-20240813-build/edk2-b158dad150bf/NetworkPkg/DnsDxe/DnsImpl.c:1276:5: note: in expansion of macro ‘ASSERT’
edk2-20240813-build/edk2-b158dad150bf/NetworkPkg/DnsDxe/DnsImpl.c:1341:5: note: in expansion of macro ‘ASSERT’
edk2-20240813-build/edk2-b158dad150bf/NetworkPkg/Include/Library/NetLib.h:220:32: note: in definition of macro ‘NTOHS’
# 1505|             }

# 1506|   

# 1507|->           HostAddr4  = Dns4TokenEntry->Token->RspData.H2AData->IpList;

# 1508|             AnswerData = (UINT8 *)AnswerSection + sizeof (*AnswerSection);

# 1509|             CopyMem (&HostAddr4[IpCount], AnswerData, sizeof (EFI_IPv4_ADDRESS));


Error: GCC_ANALYZER_WARNING (CWE-476): [#def217]
edk2-20240813-build/edk2-b158dad150bf/NetworkPkg/DnsDxe/DnsImpl.c:1569:38: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘Dns6TokenEntry’
edk2-20240813-build/edk2-b158dad150bf/NetworkPkg/DnsDxe/DnsImpl.c:1085:3: note: in expansion of macro ‘NET_LIST_FOR_EACH’
edk2-20240813-build/edk2-b158dad150bf/NetworkPkg/DnsDxe/DnsImpl.c:1260:5: note: in expansion of macro ‘ASSERT’
edk2-20240813-build/edk2-b158dad150bf/NetworkPkg/DnsDxe/DnsImpl.c:1302:5: note: in expansion of macro ‘ASSERT’
edk2-20240813-build/edk2-b158dad150bf/NetworkPkg/Include/Library/NetLib.h:220:32: note: in definition of macro ‘NTOHS’
# 1567|             }

# 1568|   

# 1569|->           HostAddr6  = Dns6TokenEntry->Token->RspData.H2AData->IpList;

# 1570|             AnswerData = (UINT8 *)AnswerSection + sizeof (*AnswerSection);

# 1571|             CopyMem (&HostAddr6[IpCount], AnswerData, sizeof (EFI_IPv6_ADDRESS));


Error: GCC_ANALYZER_WARNING (CWE-476): [#def218]
edk2-20240813-build/edk2-b158dad150bf/NetworkPkg/DnsDxe/DnsImpl.c:1644:23: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘Dns4TokenEntry’
edk2-20240813-build/edk2-b158dad150bf/NetworkPkg/DnsDxe/DnsImpl.c:1085:3: note: in expansion of macro ‘NET_LIST_FOR_EACH’
edk2-20240813-build/edk2-b158dad150bf/NetworkPkg/DnsDxe/DnsImpl.c:1276:5: note: in expansion of macro ‘ASSERT’
edk2-20240813-build/edk2-b158dad150bf/NetworkPkg/DnsDxe/DnsImpl.c:1341:5: note: in expansion of macro ‘ASSERT’
edk2-20240813-build/edk2-b158dad150bf/NetworkPkg/DnsDxe/DnsImpl.c:1642:5: note: in expansion of macro ‘ASSERT’
# 1642|       ASSERT (Dns4TokenEntry != NULL);

# 1643|   

# 1644|->     if (Dns4TokenEntry->GeneralLookUp) {

# 1645|         Dns4TokenEntry->Token->RspData.GLookupData->RRCount = RRCount;

# 1646|       } else {


Error: GCC_ANALYZER_WARNING (CWE-476): [#def219]
edk2-20240813-build/edk2-b158dad150bf/NetworkPkg/DnsDxe/DnsImpl.c:1657:23: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘Dns6TokenEntry’
edk2-20240813-build/edk2-b158dad150bf/NetworkPkg/DnsDxe/DnsImpl.c:1085:3: note: in expansion of macro ‘NET_LIST_FOR_EACH’
edk2-20240813-build/edk2-b158dad150bf/NetworkPkg/DnsDxe/DnsImpl.c:1260:5: note: in expansion of macro ‘ASSERT’
edk2-20240813-build/edk2-b158dad150bf/NetworkPkg/DnsDxe/DnsImpl.c:1302:5: note: in expansion of macro ‘ASSERT’
edk2-20240813-build/edk2-b158dad150bf/NetworkPkg/DnsDxe/DnsImpl.c:1655:5: note: in expansion of macro ‘ASSERT’
# 1655|       ASSERT (Dns6TokenEntry != NULL);

# 1656|   

# 1657|->     if (Dns6TokenEntry->GeneralLookUp) {

# 1658|         Dns6TokenEntry->Token->RspData.GLookupData->RRCount = RRCount;

# 1659|       } else {


Error: GCC_ANALYZER_WARNING (CWE-476): [#def220]
edk2-20240813-build/edk2-b158dad150bf/NetworkPkg/HttpDxe/HttpsSupport.c: scope_hint: In function ‘TlsCommonReceive’
edk2-20240813-build/edk2-b158dad150bf/NetworkPkg/HttpDxe/HttpsSupport.c:944:51: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘Tcp4RxData’
#  942|     while (CurrentFragment < FragmentCount) {

#  943|       if (!HttpInstance->LocalAddressIsIPv6) {

#  944|->       Tcp4RxData->DataLength                      = Fragment[CurrentFragment].Len;

#  945|         Tcp4RxData->FragmentTable[0].FragmentLength = Fragment[CurrentFragment].Len;

#  946|         Tcp4RxData->FragmentTable[0].FragmentBuffer = Fragment[CurrentFragment].Bulk;


Error: GCC_ANALYZER_WARNING (CWE-476): [#def221]
edk2-20240813-build/edk2-b158dad150bf/NetworkPkg/HttpDxe/HttpsSupport.c:949:51: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘Tcp6RxData’
#  947|         Status                                      = HttpInstance->Tcp4->Receive (HttpInstance->Tcp4, &HttpInstance->Tcp4TlsRxToken);

#  948|       } else {

#  949|->       Tcp6RxData->DataLength                      = Fragment[CurrentFragment].Len;

#  950|         Tcp6RxData->FragmentTable[0].FragmentLength = Fragment[CurrentFragment].Len;

#  951|         Tcp6RxData->FragmentTable[0].FragmentBuffer = Fragment[CurrentFragment].Bulk;


Error: GCC_ANALYZER_WARNING (CWE-476): [#def222]
edk2-20240813-build/edk2-b158dad150bf/NetworkPkg/IScsiDxe/IScsiConfig.c: scope_hint: In function ‘IScsiConfigProcessDefault’
edk2-20240813-build/edk2-b158dad150bf/NetworkPkg/IScsiDxe/IScsiConfig.c:2839:33: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘0’
# 2837|       ASSERT (AttemptConfigData != NULL);

# 2838|       UnicodeStrToAsciiStrS (MacString, AttemptConfigData->MacString, sizeof (AttemptConfigData->MacString));

# 2839|->     AttemptConfigData->NicIndex = NicIndex;

# 2840|       AttemptConfigData->Actived  = ISCSI_ACTIVE_ENABLED;

# 2841|   


Error: GCC_ANALYZER_WARNING (CWE-476): [#def223]
edk2-20240813-build/edk2-b158dad150bf/NetworkPkg/IScsiDxe/IScsiDriver.c: scope_hint: In function ‘IScsiStart’
edk2-20240813-build/edk2-b158dad150bf/NetworkPkg/IScsiDxe/IScsiDriver.c:907:9: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘ExistPrivate’
edk2-20240813-build/edk2-b158dad150bf/NetworkPkg/IScsiDxe/IScsiImpl.h:45: included_from: Included from here.
edk2-20240813-build/edk2-b158dad150bf/NetworkPkg/IScsiDxe/IScsiDriver.c:12: included_from: Included from here.
edk2-20240813-build/edk2-b158dad150bf/NetworkPkg/Include/Library/NetLib.h:637:16: note: in definition of macro ‘NET_LIST_FOR_EACH_SAFE’
#  905|           // Clear the resource in ExistPrivate.

#  906|           //

#  907|->         gBS->UninstallProtocolInterface (

#  908|                  ExistPrivate->Controller,

#  909|                  IScsiPrivateGuid,


Error: GCC_ANALYZER_WARNING (CWE-476): [#def224]
edk2-20240813-build/edk2-b158dad150bf/NetworkPkg/IScsiDxe/IScsiMisc.c: scope_hint: In function ‘IScsiGetConfigData’
edk2-20240813-build/edk2-b158dad150bf/NetworkPkg/IScsiDxe/IScsiMisc.c:2223:83: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘NicInfo’
# 2221|       NicInfo = IScsiGetNicInfoByIndex (mPrivate->CurrentNic);

# 2222|       ASSERT (NicInfo != NULL);

# 2223|->     IScsiMacAddrToStr (&NicInfo->PermanentAddress, NicInfo->HwAddressSize, NicInfo->VlanId, MacString);

# 2224|       UnicodeSPrint (

# 2225|         mPrivate->PortString,


Error: GCC_ANALYZER_WARNING (CWE-476): [#def225]
edk2-20240813-build/edk2-b158dad150bf/NetworkPkg/Dhcp4Dxe/Dhcp4Impl.h:27: included_from: Included from here.
edk2-20240813-build/edk2-b158dad150bf/NetworkPkg/Dhcp4Dxe/Dhcp4Io.c:9: included_from: Included from here.
edk2-20240813-build/edk2-b158dad150bf/NetworkPkg/Dhcp4Dxe/Dhcp4Io.c: scope_hint: In function ‘DhcpSendMessage’
edk2-20240813-build/edk2-b158dad150bf/NetworkPkg/Include/Library/NetLib.h:242:35: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘SeedHead’
edk2-20240813-build/edk2-b158dad150bf/NetworkPkg/Dhcp4Dxe/Dhcp4Io.c:1225:16: note: in expansion of macro ‘EFI_IP4’
edk2-20240813-build/edk2-b158dad150bf/NetworkPkg/Dhcp4Dxe/Dhcp4Impl.h:22: included_from: Included from here.
edk2-20240813-build/edk2-b158dad150bf/NetworkPkg/Dhcp4Dxe/Dhcp4Io.c:1224:7: note: in expansion of macro ‘ASSERT’
edk2-20240813-build/edk2-b158dad150bf/NetworkPkg/Dhcp4Dxe/Dhcp4Io.c:1225:16: note: in expansion of macro ‘EFI_IP4’
#  240|   // Convert the EFI_IP4_ADDRESS to plain UINT32 IP4 address.

#  241|   //

#  242|-> #define EFI_IP4(EfiIpAddr)       (*(IP4_ADDR *) ((EfiIpAddr).Addr))

#  243|   #define EFI_NTOHL(EfiIp)         (NTOHL (EFI_IP4 ((EfiIp))))

#  244|   #define EFI_IP4_EQUAL(Ip1, Ip2)  (CompareMem ((Ip1), (Ip2), sizeof (EFI_IPv4_ADDRESS)) == 0)


Error: GCC_ANALYZER_WARNING (CWE-124): [#def226]
edk2-20240813-build/edk2-b158dad150bf/NetworkPkg/Ip6Dxe/Ip6ConfigNv.c: scope_hint: In function ‘Ip6ConvertAddressListToString.part.0’
edk2-20240813-build/edk2-b158dad150bf/NetworkPkg/Ip6Dxe/Ip6ConfigNv.c:548:17: warning[-Wanalyzer-out-of-bounds]: stack-based buffer underwrite
edk2-20240813-build/edk2-b158dad150bf/NetworkPkg/Ip6Dxe/Ip6ConfigNv.c: scope_hint: In function ‘Ip6ConvertAddressListToString.part.0’
edk2-20240813-build/edk2-b158dad150bf/NetworkPkg/Ip6Dxe/Ip6ConfigNv.c: scope_hint: In function ‘Ip6ConvertAddressListToString.part.0’
edk2-20240813-build/edk2-b158dad150bf/NetworkPkg/Ip6Dxe/Ip6Impl.h:28: included_from: Included from here.
edk2-20240813-build/edk2-b158dad150bf/NetworkPkg/Ip6Dxe/Ip6ConfigNv.c:10: included_from: Included from here.
edk2-20240813-build/edk2-b158dad150bf/NetworkPkg/Ip6Dxe/Ip6ConfigNv.c:179:5: note: in expansion of macro ‘ASSERT’
edk2-20240813-build/edk2-b158dad150bf/NetworkPkg/Ip6Dxe/Ip6ConfigNv.c:179:5: note: in expansion of macro ‘ASSERT’
edk2-20240813-build/edk2-b158dad150bf/NetworkPkg/Ip6Dxe/Ip6ConfigNv.c:179:5: note: in expansion of macro ‘ASSERT’
edk2-20240813-build/edk2-b158dad150bf/NetworkPkg/Ip6Dxe/Ip6ConfigNv.c: scope_hint: In function ‘Ip6ConvertAddressListToString.part.0’
edk2-20240813-build/edk2-b158dad150bf/NetworkPkg/Ip6Dxe/Ip6ConfigNv.c: scope_hint: In function ‘Ip6ConvertAddressListToString.part.0’
edk2-20240813-build/edk2-b158dad150bf/NetworkPkg/Ip6Dxe/Ip6ConfigNv.c:548:17: note: valid subscripts for ‘PortString’ are ‘[0]’ to ‘[254]’
#  546|     }

#  547|   

#  548|->   *(String - 1) = '\0';

#  549|   

#  550|     Status = HiiUpdateForm (


Error: GCC_ANALYZER_WARNING (CWE-476): [#def227]
edk2-20240813-build/edk2-b158dad150bf/NetworkPkg/Ip6Dxe/Ip6ConfigNv.c: scope_hint: In function ‘Ip6GetCurrentSetting’
edk2-20240813-build/edk2-b158dad150bf/NetworkPkg/Ip6Dxe/Ip6ConfigNv.c:1566:20: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘IfInfo’
# 1564|                Ip6ConfigNvHostAddress,

# 1565|                IfInfo->AddressInfo,

# 1566|->              IfInfo->AddressInfoCount

# 1567|                );

# 1568|     if (EFI_ERROR (Status)) {


Error: GCC_ANALYZER_WARNING (CWE-476): [#def228]
edk2-20240813-build/edk2-b158dad150bf/NetworkPkg/Library/DxeNetLib/NetBuffer.c: scope_hint: In function ‘NetbufQueCopy’
edk2-20240813-build/edk2-b158dad150bf/NetworkPkg/Library/DxeNetLib/NetBuffer.c:1485:14: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘Nbuf’
edk2-20240813-build/edk2-b158dad150bf/NetworkPkg/Library/DxeNetLib/NetBuffer.c:10: included_from: Included from here.
edk2-20240813-build/edk2-b158dad150bf/NetworkPkg/Library/DxeNetLib/NetBuffer.c:1469:3: note: in expansion of macro ‘NET_LIST_FOR_EACH’
edk2-20240813-build/edk2-b158dad150bf/NetworkPkg/Library/DxeNetLib/NetBuffer.c:12: included_from: Included from here.
edk2-20240813-build/edk2-b158dad150bf/NetworkPkg/Library/DxeNetLib/NetBuffer.c:1479:3: note: in expansion of macro ‘ASSERT’
# 1483|     //

# 1484|     Skip = Offset - Cur;

# 1485|->   Left = Nbuf->TotalSize - Skip;

# 1486|   

# 1487|     if (Len < Left) {


Error: GCC_ANALYZER_WARNING (CWE-476): [#def229]
edk2-20240813-build/edk2-b158dad150bf/NetworkPkg/Library/DxeTcpIoLib/DxeTcpIoLib.c: scope_hint: In function ‘TcpIoConnect’
edk2-20240813-build/edk2-b158dad150bf/NetworkPkg/Library/DxeTcpIoLib/DxeTcpIoLib.c:568:11: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘Tcp4’
#  566|     while (!TcpIo->IsConnDone && ((Timeout == NULL) || EFI_ERROR (gBS->CheckEvent (Timeout)))) {

#  567|       if (TcpIo->TcpVersion == TCP_VERSION_4) {

#  568|->       Tcp4->Poll (Tcp4);

#  569|       } else {

#  570|         Tcp6->Poll (Tcp6);


Error: GCC_ANALYZER_WARNING (CWE-476): [#def230]
edk2-20240813-build/edk2-b158dad150bf/NetworkPkg/Library/DxeTcpIoLib/DxeTcpIoLib.c:570:11: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘Tcp6’
#  568|         Tcp4->Poll (Tcp4);

#  569|       } else {

#  570|->       Tcp6->Poll (Tcp6);

#  571|       }

#  572|     }


Error: GCC_ANALYZER_WARNING (CWE-476): [#def231]
edk2-20240813-build/edk2-b158dad150bf/NetworkPkg/Library/DxeTcpIoLib/DxeTcpIoLib.c:576:11: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘Tcp4’
#  574|     if (!TcpIo->IsConnDone) {

#  575|       if (TcpIo->TcpVersion == TCP_VERSION_4) {

#  576|->       Tcp4->Cancel (Tcp4, &TcpIo->ConnToken.Tcp4Token.CompletionToken);

#  577|       } else {

#  578|         Tcp6->Cancel (Tcp6, &TcpIo->ConnToken.Tcp6Token.CompletionToken);


Error: GCC_ANALYZER_WARNING (CWE-476): [#def232]
edk2-20240813-build/edk2-b158dad150bf/NetworkPkg/Library/DxeTcpIoLib/DxeTcpIoLib.c:578:11: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘Tcp6’
#  576|         Tcp4->Cancel (Tcp4, &TcpIo->ConnToken.Tcp4Token.CompletionToken);

#  577|       } else {

#  578|->       Tcp6->Cancel (Tcp6, &TcpIo->ConnToken.Tcp6Token.CompletionToken);

#  579|       }

#  580|   


Error: GCC_ANALYZER_WARNING (CWE-476): [#def233]
edk2-20240813-build/edk2-b158dad150bf/NetworkPkg/Library/DxeTcpIoLib/DxeTcpIoLib.c: scope_hint: In function ‘TcpIoAccept’
edk2-20240813-build/edk2-b158dad150bf/NetworkPkg/Library/DxeTcpIoLib/DxeTcpIoLib.c:644:11: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘Tcp4’
#  642|     while (!TcpIo->IsListenDone && ((Timeout == NULL) || EFI_ERROR (gBS->CheckEvent (Timeout)))) {

#  643|       if (TcpIo->TcpVersion == TCP_VERSION_4) {

#  644|->       Tcp4->Poll (Tcp4);

#  645|       } else {

#  646|         Tcp6->Poll (Tcp6);


Error: GCC_ANALYZER_WARNING (CWE-476): [#def234]
edk2-20240813-build/edk2-b158dad150bf/NetworkPkg/Library/DxeTcpIoLib/DxeTcpIoLib.c:646:11: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘Tcp6’
#  644|         Tcp4->Poll (Tcp4);

#  645|       } else {

#  646|->       Tcp6->Poll (Tcp6);

#  647|       }

#  648|     }


Error: GCC_ANALYZER_WARNING (CWE-476): [#def235]
edk2-20240813-build/edk2-b158dad150bf/NetworkPkg/Library/DxeTcpIoLib/DxeTcpIoLib.c:652:11: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘Tcp4’
#  650|     if (!TcpIo->IsListenDone) {

#  651|       if (TcpIo->TcpVersion == TCP_VERSION_4) {

#  652|->       Tcp4->Cancel (Tcp4, &TcpIo->ListenToken.Tcp4Token.CompletionToken);

#  653|       } else {

#  654|         Tcp6->Cancel (Tcp6, &TcpIo->ListenToken.Tcp6Token.CompletionToken);


Error: GCC_ANALYZER_WARNING (CWE-476): [#def236]
edk2-20240813-build/edk2-b158dad150bf/NetworkPkg/Library/DxeTcpIoLib/DxeTcpIoLib.c:654:11: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘Tcp6’
#  652|         Tcp4->Cancel (Tcp4, &TcpIo->ListenToken.Tcp4Token.CompletionToken);

#  653|       } else {

#  654|->       Tcp6->Cancel (Tcp6, &TcpIo->ListenToken.Tcp6Token.CompletionToken);

#  655|       }

#  656|   


Error: GCC_ANALYZER_WARNING (CWE-476): [#def237]
edk2-20240813-build/edk2-b158dad150bf/NetworkPkg/Library/DxeTcpIoLib/DxeTcpIoLib.c: scope_hint: In function ‘TcpIoReset’
edk2-20240813-build/edk2-b158dad150bf/NetworkPkg/Library/DxeTcpIoLib/DxeTcpIoLib.c:728:11: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘Tcp4’
#  726|     while (!TcpIo->IsCloseDone) {

#  727|       if (TcpIo->TcpVersion == TCP_VERSION_4) {

#  728|->       Tcp4->Poll (Tcp4);

#  729|       } else {

#  730|         Tcp6->Poll (Tcp6);


Error: GCC_ANALYZER_WARNING (CWE-476): [#def238]
edk2-20240813-build/edk2-b158dad150bf/NetworkPkg/Library/DxeTcpIoLib/DxeTcpIoLib.c:730:11: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘Tcp6’
#  728|         Tcp4->Poll (Tcp4);

#  729|       } else {

#  730|->       Tcp6->Poll (Tcp6);

#  731|       }

#  732|     }


Error: GCC_ANALYZER_WARNING (CWE-476): [#def239]
edk2-20240813-build/edk2-b158dad150bf/NetworkPkg/Library/DxeTcpIoLib/DxeTcpIoLib.c: scope_hint: In function ‘TcpIoTransmit’
edk2-20240813-build/edk2-b158dad150bf/NetworkPkg/Library/DxeTcpIoLib/DxeTcpIoLib.c:836:11: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘Tcp4’
#  834|     while (!TcpIo->IsTxDone) {

#  835|       if (TcpIo->TcpVersion == TCP_VERSION_4) {

#  836|->       Tcp4->Poll (Tcp4);

#  837|       } else {

#  838|         Tcp6->Poll (Tcp6);


Error: GCC_ANALYZER_WARNING (CWE-476): [#def240]
edk2-20240813-build/edk2-b158dad150bf/NetworkPkg/Library/DxeTcpIoLib/DxeTcpIoLib.c:838:11: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘Tcp6’
#  836|         Tcp4->Poll (Tcp4);

#  837|       } else {

#  838|->       Tcp6->Poll (Tcp6);

#  839|       }

#  840|     }


Error: GCC_ANALYZER_WARNING (CWE-476): [#def241]
edk2-20240813-build/edk2-b158dad150bf/NetworkPkg/Library/DxeTcpIoLib/DxeTcpIoLib.c: scope_hint: In function ‘TcpIoReceive’
edk2-20240813-build/edk2-b158dad150bf/NetworkPkg/Library/DxeTcpIoLib/DxeTcpIoLib.c:945:20: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘Tcp4’
#  943|   

#  944|       if (TcpIo->TcpVersion == TCP_VERSION_4) {

#  945|->       Status = Tcp4->Receive (Tcp4, &TcpIo->RxToken.Tcp4Token);

#  946|       } else {

#  947|         Status = Tcp6->Receive (Tcp6, &TcpIo->RxToken.Tcp6Token);


Error: GCC_ANALYZER_WARNING (CWE-476): [#def242]
edk2-20240813-build/edk2-b158dad150bf/NetworkPkg/Library/DxeTcpIoLib/DxeTcpIoLib.c:947:20: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘Tcp6’
#  945|         Status = Tcp4->Receive (Tcp4, &TcpIo->RxToken.Tcp4Token);

#  946|       } else {

#  947|->       Status = Tcp6->Receive (Tcp6, &TcpIo->RxToken.Tcp6Token);

#  948|       }

#  949|   


Error: GCC_ANALYZER_WARNING (CWE-476): [#def243]
edk2-20240813-build/edk2-b158dad150bf/NetworkPkg/Library/DxeTcpIoLib/DxeTcpIoLib.c:959:13: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘Tcp4’
#  957|         //

#  958|         if (TcpIo->TcpVersion == TCP_VERSION_4) {

#  959|->         Tcp4->Poll (Tcp4);

#  960|         } else {

#  961|           Tcp6->Poll (Tcp6);


Error: GCC_ANALYZER_WARNING (CWE-476): [#def244]
edk2-20240813-build/edk2-b158dad150bf/NetworkPkg/Library/DxeTcpIoLib/DxeTcpIoLib.c:961:13: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘Tcp6’
#  959|           Tcp4->Poll (Tcp4);

#  960|         } else {

#  961|->         Tcp6->Poll (Tcp6);

#  962|         }

#  963|       }


Error: GCC_ANALYZER_WARNING (CWE-476): [#def245]
edk2-20240813-build/edk2-b158dad150bf/NetworkPkg/Library/DxeTcpIoLib/DxeTcpIoLib.c:970:13: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘Tcp4’
#  968|         //

#  969|         if (TcpIo->TcpVersion == TCP_VERSION_4) {

#  970|->         Tcp4->Cancel (Tcp4, &TcpIo->RxToken.Tcp4Token.CompletionToken);

#  971|         } else {

#  972|           Tcp6->Cancel (Tcp6, &TcpIo->RxToken.Tcp6Token.CompletionToken);


Error: GCC_ANALYZER_WARNING (CWE-476): [#def246]
edk2-20240813-build/edk2-b158dad150bf/NetworkPkg/Library/DxeTcpIoLib/DxeTcpIoLib.c:972:13: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘Tcp6’
#  970|           Tcp4->Cancel (Tcp4, &TcpIo->RxToken.Tcp4Token.CompletionToken);

#  971|         } else {

#  972|->         Tcp6->Cancel (Tcp6, &TcpIo->RxToken.Tcp6Token.CompletionToken);

#  973|         }

#  974|   


Error: GCC_ANALYZER_WARNING (CWE-476): [#def247]
edk2-20240813-build/edk2-b158dad150bf/NetworkPkg/Include/Library/UdpIoLib.h:16: included_from: Included from here.
edk2-20240813-build/edk2-b158dad150bf/NetworkPkg/Mtftp4Dxe/Mtftp4Impl.h:30: included_from: Included from here.
edk2-20240813-build/edk2-b158dad150bf/NetworkPkg/Mtftp4Dxe/Mtftp4Rrq.c:10: included_from: Included from here.
edk2-20240813-build/edk2-b158dad150bf/NetworkPkg/Mtftp4Dxe/Mtftp4Rrq.c: scope_hint: In function ‘Mtftp4RrqInput’
edk2-20240813-build/edk2-b158dad150bf/NetworkPkg/Mtftp4Dxe/Mtftp4Rrq.c:719:25: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘Packet’
edk2-20240813-build/edk2-b158dad150bf/NetworkPkg/Include/Library/NetLib.h:220:32: note: in definition of macro ‘NTOHS’
edk2-20240813-build/edk2-b158dad150bf/NetworkPkg/Mtftp4Dxe/Mtftp4Impl.h:26: included_from: Included from here.
edk2-20240813-build/edk2-b158dad150bf/NetworkPkg/Mtftp4Dxe/Mtftp4Rrq.c:675:3: note: in expansion of macro ‘ASSERT’
edk2-20240813-build/edk2-b158dad150bf/NetworkPkg/Mtftp4Dxe/Mtftp4Rrq.c:716:5: note: in expansion of macro ‘ASSERT’
edk2-20240813-build/edk2-b158dad150bf/MdePkg/Include/Library/DebugLib.h:400:11: note: in expansion of macro ‘_ASSERT’
edk2-20240813-build/edk2-b158dad150bf/NetworkPkg/Mtftp4Dxe/Mtftp4Rrq.c:716:5: note: in expansion of macro ‘ASSERT’
edk2-20240813-build/edk2-b158dad150bf/NetworkPkg/Include/Library/NetLib.h:220:32: note: in definition of macro ‘NTOHS’
#  717|     }

#  718|   

#  719|->   Opcode = NTOHS (Packet->OpCode);

#  720|   

#  721|     //


Error: GCC_ANALYZER_WARNING (CWE-476): [#def248]
edk2-20240813-build/edk2-b158dad150bf/NetworkPkg/Include/Library/UdpIoLib.h:16: included_from: Included from here.
edk2-20240813-build/edk2-b158dad150bf/NetworkPkg/Mtftp4Dxe/Mtftp4Impl.h:30: included_from: Included from here.
edk2-20240813-build/edk2-b158dad150bf/NetworkPkg/Mtftp4Dxe/Mtftp4Wrq.c:9: included_from: Included from here.
edk2-20240813-build/edk2-b158dad150bf/NetworkPkg/Mtftp4Dxe/Mtftp4Wrq.c: scope_hint: In function ‘Mtftp4WrqInput’
edk2-20240813-build/edk2-b158dad150bf/NetworkPkg/Mtftp4Dxe/Mtftp4Wrq.c:393:25: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘Packet’
edk2-20240813-build/edk2-b158dad150bf/NetworkPkg/Include/Library/NetLib.h:220:32: note: in definition of macro ‘NTOHS’
edk2-20240813-build/edk2-b158dad150bf/NetworkPkg/Mtftp4Dxe/Mtftp4Impl.h:26: included_from: Included from here.
edk2-20240813-build/edk2-b158dad150bf/NetworkPkg/Mtftp4Dxe/Mtftp4Wrq.c:356:3: note: in expansion of macro ‘ASSERT’
edk2-20240813-build/edk2-b158dad150bf/NetworkPkg/Mtftp4Dxe/Mtftp4Wrq.c:390:5: note: in expansion of macro ‘ASSERT’
edk2-20240813-build/edk2-b158dad150bf/MdePkg/Include/Library/DebugLib.h:400:11: note: in expansion of macro ‘_ASSERT’
edk2-20240813-build/edk2-b158dad150bf/NetworkPkg/Mtftp4Dxe/Mtftp4Wrq.c:390:5: note: in expansion of macro ‘ASSERT’
edk2-20240813-build/edk2-b158dad150bf/NetworkPkg/Include/Library/NetLib.h:220:32: note: in definition of macro ‘NTOHS’
#  391|     }

#  392|   

#  393|->   Opcode = NTOHS (Packet->OpCode);

#  394|   

#  395|     //


Error: GCC_ANALYZER_WARNING (CWE-476): [#def249]
edk2-20240813-build/edk2-b158dad150bf/NetworkPkg/Mtftp6Dxe/Mtftp6Impl.h:25: included_from: Included from here.
edk2-20240813-build/edk2-b158dad150bf/NetworkPkg/Mtftp6Dxe/Mtftp6Rrq.c:10: included_from: Included from here.
edk2-20240813-build/edk2-b158dad150bf/NetworkPkg/Mtftp6Dxe/Mtftp6Rrq.c: scope_hint: In function ‘Mtftp6RrqInput’
edk2-20240813-build/edk2-b158dad150bf/NetworkPkg/Mtftp6Dxe/Mtftp6Rrq.c:764:25: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘Packet’
edk2-20240813-build/edk2-b158dad150bf/NetworkPkg/Include/Library/NetLib.h:220:32: note: in definition of macro ‘NTOHS’
edk2-20240813-build/edk2-b158dad150bf/NetworkPkg/Mtftp6Dxe/Mtftp6Impl.h:20: included_from: Included from here.
edk2-20240813-build/edk2-b158dad150bf/NetworkPkg/Mtftp6Dxe/Mtftp6Rrq.c:704:3: note: in expansion of macro ‘ASSERT’
edk2-20240813-build/edk2-b158dad150bf/NetworkPkg/Mtftp6Dxe/Mtftp6Rrq.c:761:5: note: in expansion of macro ‘ASSERT’
edk2-20240813-build/edk2-b158dad150bf/MdePkg/Include/Library/DebugLib.h:400:11: note: in expansion of macro ‘_ASSERT’
edk2-20240813-build/edk2-b158dad150bf/NetworkPkg/Mtftp6Dxe/Mtftp6Rrq.c:761:5: note: in expansion of macro ‘ASSERT’
edk2-20240813-build/edk2-b158dad150bf/NetworkPkg/Include/Library/NetLib.h:220:32: note: in definition of macro ‘NTOHS’
#  762|     }

#  763|   

#  764|->   Opcode = NTOHS (Packet->OpCode);

#  765|   

#  766|     //


Error: GCC_ANALYZER_WARNING (CWE-476): [#def250]
edk2-20240813-build/edk2-b158dad150bf/NetworkPkg/Mtftp6Dxe/Mtftp6Impl.h:25: included_from: Included from here.
edk2-20240813-build/edk2-b158dad150bf/NetworkPkg/Mtftp6Dxe/Mtftp6Wrq.c:10: included_from: Included from here.
edk2-20240813-build/edk2-b158dad150bf/NetworkPkg/Mtftp6Dxe/Mtftp6Wrq.c: scope_hint: In function ‘Mtftp6WrqInput’
edk2-20240813-build/edk2-b158dad150bf/NetworkPkg/Mtftp6Dxe/Mtftp6Wrq.c:442:25: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘Packet’
edk2-20240813-build/edk2-b158dad150bf/NetworkPkg/Include/Library/NetLib.h:220:32: note: in definition of macro ‘NTOHS’
edk2-20240813-build/edk2-b158dad150bf/NetworkPkg/Mtftp6Dxe/Mtftp6Impl.h:20: included_from: Included from here.
edk2-20240813-build/edk2-b158dad150bf/NetworkPkg/Mtftp6Dxe/Mtftp6Wrq.c:404:3: note: in expansion of macro ‘ASSERT’
edk2-20240813-build/edk2-b158dad150bf/NetworkPkg/Mtftp6Dxe/Mtftp6Wrq.c:439:5: note: in expansion of macro ‘ASSERT’
edk2-20240813-build/edk2-b158dad150bf/MdePkg/Include/Library/DebugLib.h:400:11: note: in expansion of macro ‘_ASSERT’
edk2-20240813-build/edk2-b158dad150bf/NetworkPkg/Mtftp6Dxe/Mtftp6Wrq.c:439:5: note: in expansion of macro ‘ASSERT’
edk2-20240813-build/edk2-b158dad150bf/NetworkPkg/Include/Library/NetLib.h:220:32: note: in definition of macro ‘NTOHS’
#  440|     }

#  441|   

#  442|->   Opcode = NTOHS (Packet->OpCode);

#  443|   

#  444|     //


Error: GCC_ANALYZER_WARNING (CWE-476): [#def251]
edk2-20240813-build/edk2-b158dad150bf/NetworkPkg/TcpDxe/SockImpl.c: scope_hint: In function ‘SockTcpDataToRcv’
edk2-20240813-build/edk2-b158dad150bf/NetworkPkg/TcpDxe/SockImpl.c:121:33: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘RcvBufEntry’
#  119|     // allowed length of the urgent data and output it.

#  120|     //

#  121|->   *IsUrg = (BOOLEAN)((TcpRsvData->UrgLen > 0) ? TRUE : FALSE);

#  122|   

#  123|     if (*IsUrg && (TcpRsvData->UrgLen < RcvBufEntry->TotalSize)) {


Error: GCC_ANALYZER_WARNING (CWE-476): [#def252]
edk2-20240813-build/edk2-b158dad150bf/OvmfPkg/AcpiPlatformDxe/CloudHvAcpi.c: scope_hint: In function ‘InstallCloudHvTablesTdx’
edk2-20240813-build/edk2-b158dad150bf/OvmfPkg/AcpiPlatformDxe/CloudHvAcpi.c:85:37: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘DsdtTable’
edk2-20240813-build/edk2-b158dad150bf/OvmfPkg/AcpiPlatformDxe/CloudHvAcpi.c:14: included_from: Included from here.
edk2-20240813-build/edk2-b158dad150bf/OvmfPkg/AcpiPlatformDxe/CloudHvAcpi.c:77:5: note: in expansion of macro ‘DEBUG’
#   83|                              AcpiProtocol,

#   84|                              DsdtTable,

#   85|->                            DsdtTable->Length,

#   86|                              &TableHandle

#   87|                              );


Error: GCC_ANALYZER_WARNING (CWE-476): [#def253]
edk2-20240813-build/edk2-b158dad150bf/OvmfPkg/AcpiPlatformDxe/CloudHvAcpi.c: scope_hint: In function ‘InstallCloudHvTables’
edk2-20240813-build/edk2-b158dad150bf/OvmfPkg/AcpiPlatformDxe/CloudHvAcpi.c:218:37: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘DsdtTable’
edk2-20240813-build/edk2-b158dad150bf/OvmfPkg/AcpiPlatformDxe/CloudHvAcpi.c:210:5: note: in expansion of macro ‘DEBUG’
#  216|                              AcpiProtocol,

#  217|                              DsdtTable,

#  218|->                            DsdtTable->Length,

#  219|                              &TableHandle

#  220|                              );


Error: GCC_ANALYZER_WARNING (CWE-457): [#def254]
edk2-20240813-build/edk2-b158dad150bf/OvmfPkg/IntelTdx/TdxHelperLib/SecTdxHelper.c: scope_hint: In function ‘AcceptMemoryForAPsStack’
edk2-20240813-build/edk2-b158dad150bf/OvmfPkg/IntelTdx/TdxHelperLib/SecTdxHelper.c:385:23: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value ‘PhysicalEnd’
edk2-20240813-build/edk2-b158dad150bf/OvmfPkg/IntelTdx/TdxHelperLib/SecTdxHelper.c:12: included_from: Included from here.
edk2-20240813-build/edk2-b158dad150bf/OvmfPkg/IntelTdx/TdxHelperLib/SecTdxHelper.c:787:3: note: in expansion of macro ‘DEBUG’
edk2-20240813-build/edk2-b158dad150bf/Build/OvmfX64/DEBUG_GCC5/X64/OvmfPkg/IntelTdx/TdxHelperLib/SecTdxHelperLib/DEBUG/AutoGen.h:16: included_from: Included from here.
<command-line>: included_from: Included from here.
edk2-20240813-build/edk2-b158dad150bf/MdePkg/Include/Base.h:948:42: note: in definition of macro ‘ALIGN_VALUE’
edk2-20240813-build/edk2-b158dad150bf/OvmfPkg/IntelTdx/TdxHelperLib/SecTdxHelper.c:748:51: note: in expansion of macro ‘APS_STACK_SIZE’
#  383|   

#  384|     ASSERT (MemoryRegionFound);

#  385|->   *PhysicalAddressEnd = PhysicalEnd;

#  386|   

#  387|     return Status;


Error: GCC_ANALYZER_WARNING (CWE-476): [#def255]
edk2-20240813-build/edk2-b158dad150bf/OvmfPkg/IoMmuDxe/CcIoMmu.c: scope_hint: In function ‘IoMmuUnmapWorker’
edk2-20240813-build/edk2-b158dad150bf/OvmfPkg/IoMmuDxe/CcIoMmu.c:445:25: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘CommonBufferHeader’
#  443|       CopyMem (

#  444|         (VOID *)(UINTN)MapInfo->CryptedAddress,

#  445|->       CommonBufferHeader->StashBuffer,

#  446|         MapInfo->NumberOfBytes

#  447|         );


Error: GCC_ANALYZER_WARNING (CWE-476): [#def256]
edk2-20240813-build/edk2-b158dad150bf/OvmfPkg/Library/AcpiPlatformLib/DxeAcpiPlatformLib.c: scope_hint: In function ‘InstallAcpiTablesFromRsdp’
edk2-20240813-build/edk2-b158dad150bf/OvmfPkg/Library/AcpiPlatformLib/DxeAcpiPlatformLib.c:244:37: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘DsdtTable’
edk2-20240813-build/edk2-b158dad150bf/OvmfPkg/Library/AcpiPlatformLib/DxeAcpiPlatformLib.c:14: included_from: Included from here.
edk2-20240813-build/edk2-b158dad150bf/OvmfPkg/Library/AcpiPlatformLib/DxeAcpiPlatformLib.c:236:5: note: in expansion of macro ‘DEBUG’
#  242|                              AcpiProtocol,

#  243|                              DsdtTable,

#  244|->                            DsdtTable->Length,

#  245|                              &TableHandle

#  246|                              );


Error: GCC_ANALYZER_WARNING (CWE-476): [#def257]
edk2-20240813-build/edk2-b158dad150bf/OvmfPkg/Library/BaseMemEncryptSevLib/X64/VirtualMemory.h:21: included_from: Included from here.
edk2-20240813-build/edk2-b158dad150bf/OvmfPkg/Library/BaseMemEncryptSevLib/X64/PeiDxeVirtualMemory.c:19: included_from: Included from here.
edk2-20240813-build/edk2-b158dad150bf/OvmfPkg/Library/BaseMemEncryptSevLib/X64/PeiDxeVirtualMemory.c: scope_hint: In function ‘Split2MPageTo4K’
edk2-20240813-build/edk2-b158dad150bf/OvmfPkg/Library/BaseMemEncryptSevLib/X64/PeiDxeVirtualMemory.c:209:11: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘PageEntry2M’
edk2-20240813-build/edk2-b158dad150bf/MdePkg/Include/Library/DebugLib.h:399:15: note: in definition of macro ‘ASSERT’
edk2-20240813-build/edk2-b158dad150bf/OvmfPkg/Library/BaseMemEncryptSevLib/X64/PeiDxeVirtualMemory.c:209:3: note: in expansion of macro ‘ASSERT’
edk2-20240813-build/edk2-b158dad150bf/MdePkg/Include/Library/DebugLib.h:399:15: note: in definition of macro ‘ASSERT’
edk2-20240813-build/edk2-b158dad150bf/MdePkg/Include/Library/DebugLib.h:399:15: note: in definition of macro ‘ASSERT’
#  207|   

#  208|     ASSERT (PageTableEntry != NULL);

#  209|->   ASSERT (*PageEntry2M & AddressEncMask);

#  210|   

#  211|     PhysicalAddress4K = PhysicalAddress;


Error: GCC_ANALYZER_WARNING (CWE-476): [#def258]
edk2-20240813-build/edk2-b158dad150bf/OvmfPkg/Library/BaseMemEncryptSevLib/X64/PeiDxeVirtualMemory.c:221:36: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘PageTableEntry’
#  219|       // Fill in the Page Table entries

#  220|       //

#  221|->     PageTableEntry->Uint64         = (UINT64)PhysicalAddress4K | AddressEncMask;

#  222|       PageTableEntry->Bits.ReadWrite = 1;

#  223|       PageTableEntry->Bits.Present   = 1;


Error: GCC_ANALYZER_WARNING (CWE-476): [#def259]
edk2-20240813-build/edk2-b158dad150bf/OvmfPkg/Library/BaseMemEncryptSevLib/X64/PeiDxeVirtualMemory.c: scope_hint: In function ‘Split1GPageTo2M’
edk2-20240813-build/edk2-b158dad150bf/OvmfPkg/Library/BaseMemEncryptSevLib/X64/PeiDxeVirtualMemory.c:481:42: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘PageDirectoryEntry’
#  479|         // Fill in the Page Directory entries

#  480|         //

#  481|->       PageDirectoryEntry->Uint64         = (UINT64)PhysicalAddress2M | AddressEncMask;

#  482|         PageDirectoryEntry->Bits.ReadWrite = 1;

#  483|         PageDirectoryEntry->Bits.Present   = 1;


Error: GCC_ANALYZER_WARNING (CWE-457): [#def260]
edk2-20240813-build/edk2-b158dad150bf/OvmfPkg/Library/BaseMemEncryptSevLib/X64/SnpPageStateChangeInternal.c: scope_hint: In function ‘MemoryStateToGhcbOp’
edk2-20240813-build/edk2-b158dad150bf/OvmfPkg/Library/BaseMemEncryptSevLib/X64/SnpPageStateChangeInternal.c:41:10: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value ‘Cmd’
#   39|     }

#   40|   

#   41|->   return Cmd;

#   42|   }

#   43|   


Error: GCC_ANALYZER_WARNING (CWE-457): [#def261]
edk2-20240813-build/edk2-b158dad150bf/OvmfPkg/Library/CcExitLib/CcExitVcHandler.c: scope_hint: In function ‘CpuidExit’
edk2-20240813-build/edk2-b158dad150bf/OvmfPkg/Library/CcExitLib/CcExitVcHandler.c:1452:10: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value ‘XCr0’
# 1450|   

# 1451|     if (SnpEnabled ()) {

# 1452|->     if (!GetCpuidFw (

# 1453|              Ghcb,

# 1454|              EaxIn,


Error: GCC_ANALYZER_WARNING (CWE-457): [#def262]
edk2-20240813-build/edk2-b158dad150bf/OvmfPkg/Library/CcExitLib/CcExitVcHandler.c:1468:10: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value ‘XCr0’
# 1466|       }

# 1467|     } else {

# 1468|->     if (!GetCpuidHyp (

# 1469|              Ghcb,

# 1470|              EaxIn,


Error: GCC_ANALYZER_WARNING (CWE-476): [#def263]
edk2-20240813-build/edk2-b158dad150bf/OvmfPkg/Library/CcExitLib/CcInstruction.c: scope_hint: In function ‘GetEffectiveMemoryAddress’
edk2-20240813-build/edk2-b158dad150bf/OvmfPkg/Library/CcExitLib/CcInstruction.c:222:27: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘0’
edk2-20240813-build/edk2-b158dad150bf/MdePkg/Include/Register/Amd/Ghcb.h:20: included_from: Included from here.
edk2-20240813-build/edk2-b158dad150bf/OvmfPkg/Library/CcExitLib/CcInstruction.h:15: included_from: Included from here.
edk2-20240813-build/edk2-b158dad150bf/OvmfPkg/Library/CcExitLib/CcInstruction.c:14: included_from: Included from here.
edk2-20240813-build/edk2-b158dad150bf/OvmfPkg/Library/CcExitLib/CcInstruction.c:91:3: note: in expansion of macro ‘ASSERT’
#  220|   

#  221|       if ((Ext->Sib.Base != 5) || Ext->ModRm.Mod) {

#  222|->       EffectiveAddress += *CcGetRegisterPointer (Regs, Ext->Sib.Base);

#  223|       } else {

#  224|         UpdateForDisplacement (InstructionData, 4);


Error: GCC_ANALYZER_WARNING (CWE-476): [#def264]
edk2-20240813-build/edk2-b158dad150bf/OvmfPkg/Library/CcExitLib/CcInstruction.c: scope_hint: In function ‘CcDecodeModRm’
edk2-20240813-build/edk2-b158dad150bf/OvmfPkg/Library/CcExitLib/CcInstruction.c:271:18: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘0’
edk2-20240813-build/edk2-b158dad150bf/OvmfPkg/Library/CcExitLib/CcInstruction.c:91:3: note: in expansion of macro ‘ASSERT’
#  269|     Ext->ModRm.Rm  = (RexPrefix->Bits.BitB << 3) | ModRm->Bits.Rm;

#  270|   

#  271|->   Ext->RegData = *CcGetRegisterPointer (Regs, Ext->ModRm.Reg);

#  272|   

#  273|     if (Ext->ModRm.Mod == 3) {


Error: GCC_ANALYZER_WARNING (CWE-476): [#def265]
edk2-20240813-build/edk2-b158dad150bf/OvmfPkg/Library/CcExitLib/CcInstruction.c:274:19: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘0’
edk2-20240813-build/edk2-b158dad150bf/OvmfPkg/Library/CcExitLib/CcInstruction.c:91:3: note: in expansion of macro ‘ASSERT’
#  272|   

#  273|     if (Ext->ModRm.Mod == 3) {

#  274|->     Ext->RmData = *CcGetRegisterPointer (Regs, Ext->ModRm.Rm);

#  275|     } else {

#  276|       if (ModRm->Bits.Rm == 4) {


Error: GCC_ANALYZER_WARNING (CWE-476): [#def266]
edk2-20240813-build/edk2-b158dad150bf/OvmfPkg/Library/QemuFwCfgLib/QemuFwCfgPei.c: scope_hint: In function ‘InternalQemuFwCfgIsAvailable’
edk2-20240813-build/edk2-b158dad150bf/OvmfPkg/Library/QemuFwCfgLib/QemuFwCfgPei.c:148:25: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘PlatformInfoHob’
#  146|     EFI_HOB_PLATFORM_INFO  *PlatformInfoHob = QemuFwCfgGetPlatformInfo ();

#  147|   

#  148|->   return PlatformInfoHob->QemuFwCfgSupported;

#  149|   }

#  150|   


Error: GCC_ANALYZER_WARNING (CWE-476): [#def267]
edk2-20240813-build/edk2-b158dad150bf/OvmfPkg/Library/QemuFwCfgLib/QemuFwCfgPei.c: scope_hint: In function ‘InternalQemuFwCfgDmaIsAvailable’
edk2-20240813-build/edk2-b158dad150bf/OvmfPkg/Library/QemuFwCfgLib/QemuFwCfgPei.c:165:25: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘PlatformInfoHob’
#  163|     EFI_HOB_PLATFORM_INFO  *PlatformInfoHob = QemuFwCfgGetPlatformInfo ();

#  164|   

#  165|->   return PlatformInfoHob->QemuFwCfgDmaSupported;

#  166|   }

#  167|   


Error: GCC_ANALYZER_WARNING (CWE-476): [#def268]
edk2-20240813-build/edk2-b158dad150bf/OvmfPkg/QemuFlashFvbServicesRuntimeDxe/FwBlockService.c: scope_hint: In function ‘FvbGetPhysicalAddress’
edk2-20240813-build/edk2-b158dad150bf/OvmfPkg/QemuFlashFvbServicesRuntimeDxe/FwBlockService.c:189:25: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘FwhInstance’
#  187|     Status = GetFvbInstance (Instance, Global, &FwhInstance);

#  188|     ASSERT_EFI_ERROR (Status);

#  189|->   *Address = FwhInstance->FvBase;

#  190|   

#  191|     return EFI_SUCCESS;


Error: GCC_ANALYZER_WARNING (CWE-476): [#def269]
edk2-20240813-build/edk2-b158dad150bf/OvmfPkg/QemuFlashFvbServicesRuntimeDxe/FwBlockService.c: scope_hint: In function ‘FvbGetLbaAddress’
edk2-20240813-build/edk2-b158dad150bf/OvmfPkg/QemuFlashFvbServicesRuntimeDxe/FwBlockService.c:305:34: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘FwhInstance’
#  303|         Offset = Offset + (UINTN)MultU64x32 ((Lba - StartLba), BlockLength);

#  304|         if (LbaAddress != NULL) {

#  305|->         *LbaAddress = FwhInstance->FvBase + Offset;

#  306|         }

#  307|   


Error: GCC_ANALYZER_WARNING (CWE-476): [#def270]
edk2-20240813-build/edk2-b158dad150bf/OvmfPkg/QemuFlashFvbServicesRuntimeDxe/FwBlockService.c: scope_hint: In function ‘FvbSetVolumeAttributes’
edk2-20240813-build/edk2-b158dad150bf/OvmfPkg/QemuFlashFvbServicesRuntimeDxe/FwBlockService.c:374:17: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘FwhInstance’
#  372|     AttribPtr =

#  373|       (EFI_FVB_ATTRIBUTES_2 *)&(FwhInstance->VolumeHeader.Attributes);

#  374|->   OldAttributes = *AttribPtr;

#  375|     Capabilities  = OldAttributes & (EFI_FVB2_READ_DISABLED_CAP | \

#  376|                                      EFI_FVB2_READ_ENABLED_CAP | \


Error: GCC_ANALYZER_WARNING (CWE-476): [#def271]
edk2-20240813-build/edk2-b158dad150bf/OvmfPkg/QemuFlashFvbServicesRuntimeDxe/FwBlockService.c: scope_hint: In function ‘FvbProtocolEraseBlocks’
edk2-20240813-build/edk2-b158dad150bf/OvmfPkg/QemuFlashFvbServicesRuntimeDxe/FwBlockService.c:661:15: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘FwhInstance’
#  659|     ASSERT_EFI_ERROR (Status);

#  660|   

#  661|->   NumOfBlocks = FwhInstance->NumOfBlocks;

#  662|   

#  663|     VA_START (args, This);


Error: GCC_ANALYZER_WARNING (CWE-476): [#def272]
edk2-20240813-build/edk2-b158dad150bf/OvmfPkg/Sec/AmdSev.c: scope_hint: In function ‘SevEsProtocolCheck’
edk2-20240813-build/edk2-b158dad150bf/OvmfPkg/Sec/AmdSev.c:225:25: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘0’
#  223|     // Set the version to the maximum that can be supported

#  224|     //

#  225|->   Ghcb->ProtocolVersion = MIN (Msr.GhcbProtocol.SevEsProtocolMax, GHCB_VERSION_MAX);

#  226|     Ghcb->GhcbUsage       = GHCB_STANDARD_USAGE;

#  227|   }


Error: GCC_ANALYZER_WARNING (CWE-476): [#def273]
edk2-20240813-build/edk2-b158dad150bf/SecurityPkg/Library/HashLibBaseCryptoRouter/HashLibBaseCryptoRouterPei.c: scope_hint: In function ‘CheckSupportedHashMaskMismatch’
edk2-20240813-build/edk2-b158dad150bf/SecurityPkg/Library/HashLibBaseCryptoRouter/HashLibBaseCryptoRouterPei.c:111:28: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘HashInterfaceHobLast’
#  109|     ASSERT (HashInterfaceHobLast != NULL);

#  110|   

#  111|->   if ((HashInterfaceHobLast->SupportedHashMask != 0) &&

#  112|         (HashInterfaceHobCurrent->SupportedHashMask != HashInterfaceHobLast->SupportedHashMask))

#  113|     {


Error: GCC_ANALYZER_WARNING (CWE-465): [#def274]
edk2-20240813-build/edk2-b158dad150bf/ShellPkg/Library/UefiShellCommandLib/UefiShellCommandLib.h:38: included_from: Included from here.
edk2-20240813-build/edk2-b158dad150bf/ShellPkg/Library/UefiShellCommandLib/UefiShellCommandLib.c:12: included_from: Included from here.
edk2-20240813-build/edk2-b158dad150bf/ShellPkg/Library/UefiShellCommandLib/UefiShellCommandLib.c: scope_hint: In function ‘FreeFileHandleList.part.0’
edk2-20240813-build/edk2-b158dad150bf/ShellPkg/Include/Library/ShellLib.h:24:8: warning[-Wanalyzer-deref-before-check]: check of ‘*BufferListEntry.Buffer’ for NULL after already dereferencing it
edk2-20240813-build/edk2-b158dad150bf/ShellPkg/Library/UefiShellCommandLib/UefiShellCommandLib.c:216:5: note: in expansion of macro ‘SHELL_FREE_NON_NULL’
edk2-20240813-build/edk2-b158dad150bf/ShellPkg/Include/Library/ShellLib.h:24:10: note: in definition of macro ‘SHELL_FREE_NON_NULL’
edk2-20240813-build/edk2-b158dad150bf/ShellPkg/Library/UefiShellCommandLib/UefiShellCommandLib.c:216:5: note: in expansion of macro ‘SHELL_FREE_NON_NULL’
#   22|   #define SHELL_FREE_NON_NULL(Pointer)  \

#   23|     do {                                \

#   24|->     if ((Pointer) != NULL) {          \

#   25|         FreePool((Pointer));            \

#   26|         (Pointer) = NULL;               \


Error: GCC_ANALYZER_WARNING (CWE-476): [#def275]
edk2-20240813-build/edk2-b158dad150bf/ShellPkg/Library/UefiShellBcfgCommandLib/UefiShellBcfgCommandLib.c: scope_hint: In function ‘UpdateOptionalData’
edk2-20240813-build/edk2-b158dad150bf/ShellPkg/Library/UefiShellBcfgCommandLib/UefiShellBcfgCommandLib.c:139:32: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘OriginalData’
edk2-20240813-build/edk2-b158dad150bf/MdePkg/Include/Uefi/UefiBaseType.h:16: included_from: Included from here.
edk2-20240813-build/edk2-b158dad150bf/MdePkg/Include/Uefi.h:17: included_from: Included from here.
edk2-20240813-build/edk2-b158dad150bf/Build/OvmfX64/DEBUG_GCC5/X64/ShellPkg/Library/UefiShellBcfgCommandLib/UefiShellBcfgCommandLib/DEBUG/AutoGen.h:16: included_from: Included from here.
<command-line>: included_from: Included from here.
edk2-20240813-build/edk2-b158dad150bf/MdePkg/Include/Uefi/UefiBaseType.h:161:23: note: in expansion of macro ‘RETURN_ERROR’
edk2-20240813-build/edk2-b158dad150bf/ShellPkg/Library/UefiShellBcfgCommandLib/UefiShellBcfgCommandLib.c:133:8: note: in expansion of macro ‘EFI_ERROR’
edk2-20240813-build/edk2-b158dad150bf/ShellPkg/Library/UefiShellBcfgCommandLib/UefiShellBcfgCommandLib.c:23: included_from: Included from here.
edk2-20240813-build/edk2-b158dad150bf/ShellPkg/Library/UefiShellBcfgCommandLib/UefiShellBcfgCommandLib.c:137:5: note: in expansion of macro ‘ASSERT’
#  137|       ASSERT (OriginalData != NULL);

#  138|       OriginalOptionDataSize  = sizeof (UINT32) + sizeof (UINT16) + StrSize (((CHAR16 *)(OriginalData + sizeof (UINT32) + sizeof (UINT16))));

#  139|->     OriginalOptionDataSize += (*(UINT16 *)(OriginalData + sizeof (UINT32)));

#  140|       OriginalOptionDataSize -= OriginalSize;

#  141|       NewSize                 = OriginalSize - OriginalOptionDataSize + DataSize;


Error: GCC_ANALYZER_WARNING (CWE-457): [#def276]
edk2-20240813-build/edk2-b158dad150bf/ShellPkg/Library/UefiShellDebug1CommandsLib/Dmem.c: scope_hint: In function ‘GetImageExecutionInfo’
edk2-20240813-build/edk2-b158dad150bf/ShellPkg/Library/UefiShellDebug1CommandsLib/Dmem.c:241:10: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value ‘Status’
#  239|     }

#  240|   

#  241|->   return Status;

#  242|   }

#  243|   


Error: GCC_ANALYZER_WARNING (CWE-457): [#def277]
edk2-20240813-build/edk2-b158dad150bf/ShellPkg/Library/UefiShellDebug1CommandsLib/Dmem.c: scope_hint: In function ‘ShellCommandRunDmem’
edk2-20240813-build/edk2-b158dad150bf/ShellPkg/Library/UefiShellDebug1CommandsLib/Dmem.c:578:27: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value ‘RtPropertiesTableAddress’
#  576|           if (ShellCommandLineGetFlag (Package, L"-verbose")) {

#  577|             if (ShellStatus == SHELL_SUCCESS) {

#  578|->             ShellStatus = DisplayRtProperties (RtPropertiesTableAddress);

#  579|             }

#  580|   


Error: GCC_ANALYZER_WARNING (CWE-476): [#def278]
edk2-20240813-build/edk2-b158dad150bf/ShellPkg/Library/UefiShellLevel2CommandsLib/Ls.c: scope_hint: In function ‘PrintSfoVolumeInfoTableEntry’
edk2-20240813-build/edk2-b158dad150bf/ShellPkg/Library/UefiShellLevel2CommandsLib/Ls.c:123:3: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘SysInfo’
edk2-20240813-build/edk2-b158dad150bf/ShellPkg/Library/UefiShellLevel2CommandsLib/UefiShellLevel2CommandsLib.h:33: included_from: Included from here.
edk2-20240813-build/edk2-b158dad150bf/ShellPkg/Library/UefiShellLevel2CommandsLib/Ls.c:10: included_from: Included from here.
edk2-20240813-build/edk2-b158dad150bf/ShellPkg/Library/UefiShellLevel2CommandsLib/Ls.c:108:5: note: in expansion of macro ‘ASSERT_EFI_ERROR’
#  121|     //

#  122|     ASSERT (SysInfo != NULL);

#  123|->   ShellPrintHiiEx (

#  124|       0,

#  125|       gST->ConOut->Mode->CursorRow,


Error: GCC_ANALYZER_WARNING (CWE-476): [#def279]
edk2-20240813-build/edk2-b158dad150bf/ShellPkg/Library/UefiShellLevel2CommandsLib/Vol.c: scope_hint: In function ‘HandleVol’
edk2-20240813-build/edk2-b158dad150bf/ShellPkg/Library/UefiShellLevel2CommandsLib/Vol.c:103:39: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘SysInfo’
edk2-20240813-build/edk2-b158dad150bf/ShellPkg/Library/UefiShellLevel2CommandsLib/UefiShellLevel2CommandsLib.h:33: included_from: Included from here.
edk2-20240813-build/edk2-b158dad150bf/ShellPkg/Library/UefiShellLevel2CommandsLib/Vol.c:10: included_from: Included from here.
edk2-20240813-build/edk2-b158dad150bf/ShellPkg/Library/UefiShellLevel2CommandsLib/Vol.c:99:3: note: in expansion of macro ‘ASSERT’
#  101|     if (Delete) {

#  102|       *((CHAR16 *)SysInfo->VolumeLabel) = CHAR_NULL;

#  103|->     SysInfo->Size                     = SIZE_OF_EFI_FILE_SYSTEM_INFO + StrSize (SysInfo->VolumeLabel);

#  104|       Status                            = EfiFpHandle->SetInfo (

#  105|                                                          EfiFpHandle,


Error: GCC_ANALYZER_WARNING (CWE-476): [#def280]
edk2-20240813-build/edk2-b158dad150bf/ShellPkg/Library/UefiShellLevel2CommandsLib/Vol.c:114:69: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘SysInfo’
edk2-20240813-build/edk2-b158dad150bf/ShellPkg/Library/UefiShellLevel2CommandsLib/Vol.c:99:3: note: in expansion of macro ‘ASSERT’
#  112|       Size2 = StrSize (SysInfo->VolumeLabel);

#  113|       if (Size1 > Size2) {

#  114|->       SysInfo = ReallocatePool ((UINTN)SysInfo->Size, (UINTN)SysInfo->Size + Size1 - Size2, SysInfo);

#  115|         if (SysInfo == NULL) {

#  116|           ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_GEN_OUT_MEM), gShellLevel2HiiHandle, L"vol");


Error: GCC_ANALYZER_WARNING (CWE-476): [#def281]
edk2-20240813-build/edk2-b158dad150bf/ShellPkg/Library/UefiShellNetwork1CommandsLib/Ping.c: scope_hint: In function ‘PingCreateIpInstance’
edk2-20240813-build/edk2-b158dad150bf/ShellPkg/Library/UefiShellNetwork1CommandsLib/Ping.c:1206:17: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘EfiSb’
# 1204|   

# 1205|     ASSERT (EfiSb != NULL);

# 1206|->   Status = EfiSb->CreateChild (EfiSb, &Private->IpChildHandle);

# 1207|   

# 1208|     if (EFI_ERROR (Status)) {


Error: GCC_ANALYZER_WARNING (CWE-476): [#def282]
edk2-20240813-build/edk2-b158dad150bf/ShellPkg/Library/UefiShellNetwork2CommandsLib/Ping6.c: scope_hint: In function ‘Ping6CreateIpInstance’
edk2-20240813-build/edk2-b158dad150bf/ShellPkg/Library/UefiShellNetwork2CommandsLib/Ping6.c:926:17: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘Ip6Sb’
#  924|   

#  925|     ASSERT (Ip6Sb != NULL);

#  926|->   Status = Ip6Sb->CreateChild (Ip6Sb, &Private->Ip6ChildHandle);

#  927|   

#  928|     if (EFI_ERROR (Status)) {


Error: GCC_ANALYZER_WARNING (CWE-476): [#def283]
edk2-20240813-build/edk2-b158dad150bf/UefiCpuPkg/Library/MpInitLib/AmdSev.c: scope_hint: In function ‘SetSevEsJumpTable’
edk2-20240813-build/edk2-b158dad150bf/UefiCpuPkg/Library/MpInitLib/AmdSev.c:186:19: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘0’
#  184|     // 16-byte aligned, so Rip is set to 0).

#  185|     //

#  186|->   JmpFar->Rip     = 0;

#  187|     JmpFar->Segment = (UINT16)(SipiVector >> 4);

#  188|   }


Error: GCC_ANALYZER_WARNING (CWE-476): [#def284]
edk2-20240813-build/edk2-b158dad150bf/UefiCpuPkg/Library/MpInitLib/PeiMpLib.c: scope_hint: In function ‘NotifyOnS3SmmInitDonePpi’
edk2-20240813-build/edk2-b158dad150bf/UefiCpuPkg/Library/MpInitLib/PeiMpLib.c:72:16: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘CpuMpData’
edk2-20240813-build/edk2-b158dad150bf/MdePkg/Include/Register/Amd/Ghcb.h:20: included_from: Included from here.
edk2-20240813-build/edk2-b158dad150bf/UefiCpuPkg/Library/MpInitLib/MpLib.h:18: included_from: Included from here.
edk2-20240813-build/edk2-b158dad150bf/UefiCpuPkg/Library/MpInitLib/PeiMpLib.c:9: included_from: Included from here.
edk2-20240813-build/edk2-b158dad150bf/UefiCpuPkg/Library/MpInitLib/PeiMpLib.c:110:5: note: in expansion of macro ‘ASSERT’
#   70|     // to the original mode.

#   71|     //

#   72|->   if (CpuMpData->ApLoopMode != ApInHltLoop) {

#   73|       CpuMpData->WakeUpByInitSipiSipi = TRUE;

#   74|     }


Error: GCC_ANALYZER_WARNING (CWE-476): [#def285]
edk2-20240813-build/edk2-b158dad150bf/UefiCpuPkg/Library/MpInitLib/PeiMpLib.c: scope_hint: In function ‘NotifyOnEndOfS3Resume’
edk2-20240813-build/edk2-b158dad150bf/UefiCpuPkg/Library/MpInitLib/PeiMpLib.c:474:30: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘CpuMpData’
edk2-20240813-build/edk2-b158dad150bf/UefiCpuPkg/Library/MpInitLib/PeiMpLib.c:110:5: note: in expansion of macro ‘ASSERT’
#  472|   

#  473|     CpuMpData       = GetCpuMpData ();

#  474|->   mNumberToFinish = CpuMpData->CpuCount - 1;

#  475|     WakeUpAP (CpuMpData, TRUE, 0, RelocateApLoop, NULL, TRUE);

#  476|     while (mNumberToFinish > 0) {


Error: GCC_ANALYZER_WARNING (CWE-457): [#def286]
edk2-20240813-build/edk2-b158dad150bf/UefiCpuPkg/Library/MpInitLib/X64/AmdSev.c: scope_hint: In function ‘SevSnpCreateAP’
edk2-20240813-build/edk2-b158dad150bf/UefiCpuPkg/Library/MpInitLib/X64/AmdSev.c:309:18: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value ‘GhcbApicIds’
#  307|   

#  308|           if (CpuMpData->InitFlag == ApInitConfig) {

#  309|->           ApicId = GhcbApicIds->ApicIds[Index];

#  310|   

#  311|             //


Error: GCC_ANALYZER_WARNING (CWE-476): [#def287]
edk2-20240813-build/edk2-b158dad150bf/UefiCpuPkg/PiSmmCpuDxeSmm/PiSmmCpuDxeSmm.c: scope_hint: In function ‘FindSmramInfo’
edk2-20240813-build/edk2-b158dad150bf/UefiCpuPkg/PiSmmCpuDxeSmm/PiSmmCpuDxeSmm.c:1469:40: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘CurrentSmramRange’
# 1467|     ASSERT (CurrentSmramRange != NULL);

# 1468|   

# 1469|->   *SmrrBase = (UINT32)CurrentSmramRange->CpuStart;

# 1470|     *SmrrSize = (UINT32)CurrentSmramRange->PhysicalSize;

# 1471|   


Error: GCC_ANALYZER_WARNING (CWE-476): [#def288]
edk2-20240813-build/edk2-b158dad150bf/UefiCpuPkg/PiSmmCpuDxeSmm/X64/PageTbl.c: scope_hint: In function ‘ReclaimPages’
edk2-20240813-build/edk2-b158dad150bf/UefiCpuPkg/PiSmmCpuDxeSmm/X64/PageTbl.c:603:53: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘ReleasePageAddress’
#  601|     // Secondly, insert the page pointed by this entry into page pool and clear this entry

#  602|     //

#  603|->   InsertTailList (&mPagePool, (LIST_ENTRY *)(UINTN)(*ReleasePageAddress & ~mAddressEncMask & gPhyMask));

#  604|     *ReleasePageAddress = 0;

#  605|   


Scan Properties

analyzer-version-clippy1.82.0
analyzer-version-cppcheck2.16.0
analyzer-version-gcc14.2.1
analyzer-version-gcc-analyzer15.0.0
analyzer-version-shellcheck0.10.0
analyzer-version-unicontrol0.0.2
enabled-pluginsclippy, cppcheck, gcc, shellcheck, unicontrol
exit-code0
hostip-172-16-1-200.us-west-2.compute.internal
mock-configfedora-rawhide-gcc-latest-x86_64
project-nameedk2-20240813-2.fc42
store-results-to/tmp/tmp4tjnjufp/edk2-20240813-2.fc42.tar.xz
time-created2024-11-13 00:46:43
time-finished2024-11-13 01:44:27
toolcsmock
tool-args'/usr/bin/csmock' '-r' 'fedora-rawhide-gcc-latest-x86_64' '-t' 'clippy,cppcheck,gcc,unicontrol,shellcheck' '-o' '/tmp/tmp4tjnjufp/edk2-20240813-2.fc42.tar.xz' '--gcc-analyze' '--unicontrol-notests' '--unicontrol-bidi-only' '--install=gcc-latest' '--gcc-analyzer-bin=/opt/gcc-latest/bin/gcc' '/tmp/tmp4tjnjufp/edk2-20240813-2.fc42.src.rpm'
tool-versioncsmock-3.7.1.20241107.094801.gb3f0f26.pr_192-1.el9