X-Git-Url: https://git.proxmox.com/?p=mirror_edk2.git;a=blobdiff_plain;f=MdeModulePkg%2FLibrary%2FBootMaintenanceManagerUiLib%2FBootMaintenance.c;h=393091f39a84b40410c2dde06875f87eb3959ae7;hp=b35e938b4057faf16102f0badf191f8adfb89067;hb=a91f1a0e88d07dd3817737f9886bc247cc737a4f;hpb=ae9026ddfa063f23ba3c7c57e3d5d6c9e0de8220 diff --git a/MdeModulePkg/Library/BootMaintenanceManagerUiLib/BootMaintenance.c b/MdeModulePkg/Library/BootMaintenanceManagerUiLib/BootMaintenance.c index b35e938b40..393091f39a 100644 --- a/MdeModulePkg/Library/BootMaintenanceManagerUiLib/BootMaintenance.c +++ b/MdeModulePkg/Library/BootMaintenanceManagerUiLib/BootMaintenance.c @@ -379,6 +379,7 @@ ExtractFileNameFromDevicePath ( String = UiDevicePathToStr(DevicePath); MatchString = String; LastMatch = String; + FileName = NULL; while(MatchString != NULL){ LastMatch = MatchString + 1; @@ -387,7 +388,9 @@ ExtractFileNameFromDevicePath ( Length = StrLen(LastMatch); FileName = AllocateCopyPool ((Length + 1) * sizeof(CHAR16), LastMatch); - *(FileName + Length) = 0; + if (FileName != NULL) { + *(FileName + Length) = 0; + } FreePool(String);