]> git.proxmox.com Git - mirror_edk2.git/blobdiff - MdePkg/Library/UefiDevicePathLib/DevicePathToText.c
MdePkg UefiDevicePathLib: Validate before touch input buffer.
[mirror_edk2.git] / MdePkg / Library / UefiDevicePathLib / DevicePathToText.c
index 92db3b1d84bbe42543e2162c87cf902ac9c32be9..5922deeea840b2a75eb24565e61890e043e9a93c 100644 (file)
@@ -42,6 +42,7 @@ UefiDevicePathLibCatPrint (
 \r
   VA_START (Args, Fmt);\r
   Count = SPrintLength (Fmt, Args);\r
+  VA_END(Args);\r
 \r
   if ((Str->Count + (Count + 1)) * sizeof (CHAR16) > Str->Capacity) {\r
     Str->Capacity = (Str->Count + (Count + 1) * 2) * sizeof (CHAR16);\r
@@ -52,6 +53,7 @@ UefiDevicePathLibCatPrint (
                  );\r
     ASSERT (Str->Str != NULL);\r
   }\r
+  VA_START (Args, Fmt);\r
   UnicodeVSPrint (&Str->Str[Str->Count], Str->Capacity - Str->Count * sizeof (CHAR16), Fmt, Args);\r
   Str->Count += Count;\r
   \r