From b98993580e3c07cfa139ed19b6fb4f1bb4db9edc Mon Sep 17 00:00:00 2001 From: Zenith432 Date: Mon, 16 May 2016 23:50:06 +0800 Subject: MdePkg: Reinitialize twice-iterated VA_LIST in variadic function UefiDevicePathLibCatPrint() Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Zenith432 Reviewed-by: Liming Gao --- MdePkg/Library/UefiDevicePathLib/DevicePathToText.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'MdePkg') diff --git a/MdePkg/Library/UefiDevicePathLib/DevicePathToText.c b/MdePkg/Library/UefiDevicePathLib/DevicePathToText.c index 92db3b1d84..5922deeea8 100644 --- a/MdePkg/Library/UefiDevicePathLib/DevicePathToText.c +++ b/MdePkg/Library/UefiDevicePathLib/DevicePathToText.c @@ -42,6 +42,7 @@ UefiDevicePathLibCatPrint ( VA_START (Args, Fmt); Count = SPrintLength (Fmt, Args); + VA_END(Args); if ((Str->Count + (Count + 1)) * sizeof (CHAR16) > Str->Capacity) { Str->Capacity = (Str->Count + (Count + 1) * 2) * sizeof (CHAR16); @@ -52,6 +53,7 @@ UefiDevicePathLibCatPrint ( ); ASSERT (Str->Str != NULL); } + VA_START (Args, Fmt); UnicodeVSPrint (&Str->Str[Str->Count], Str->Capacity - Str->Count * sizeof (CHAR16), Fmt, Args); Str->Count += Count; -- cgit v1.2.3