Build: Fix some svace analysis issues

This commit is contained in:
vit9696 2020-05-20 10:24:05 +03:00
parent ddb9862b34
commit 46e8b4b4d3
2 changed files with 11 additions and 2 deletions

View File

@ -226,6 +226,7 @@ InternalFindFirstDmgFileName (
EFI_FILE_INFO *FileInfo;
BOOLEAN NoFile;
UINTN ExtOffset;
UINTN Length;
INTN Result;
ASSERT (Directory != NULL);
@ -239,7 +240,15 @@ InternalFindFirstDmgFileName (
continue;
}
ExtOffset = (StrLen (FileInfo->FileName) - L_STR_LEN (L".dmg"));
//
// Discard filenames that do not contain characters prior to .dmg extension.
//
Length = StrLen (FileInfo->FileName);
if (Length <= L_STR_LEN (L".dmg")) {
continue;
}
ExtOffset = Length - L_STR_LEN (L".dmg");
Result = StrCmp (&FileInfo->FileName[ExtOffset], L".dmg");
if (Result == 0) {
if (FileNameLen != NULL) {

View File

@ -246,7 +246,7 @@ AppleRtcRamReset (
UINTN Index;
UINT8 Buffer[APPLE_RTC_TOTAL_SIZE];
ZeroMem (Buffer, sizeof (APPLE_RTC_TOTAL_SIZE));
ZeroMem (Buffer, sizeof (Buffer));
for (Index = APPLE_RTC_CHECKSUM_START; Index < APPLE_RTC_CORE_SIZE; ++Index) {
Status = SyncRtcWaitForReady ();