]> git.proxmox.com Git - mirror_edk2.git/blobdiff - MdePkg/Library/BasePrintLib/PrintLibInternal.c
MdePkg/PrintLib: Fix possible negative value left shift
[mirror_edk2.git] / MdePkg / Library / BasePrintLib / PrintLibInternal.c
index cec5b3bc994b20101efb9b68d20759100e940227..28d946472f2a2ef087e9555bc27a3273eac7ce28 100644 (file)
@@ -1165,7 +1165,7 @@ BasePrintLibSPrintMarker (
     // Copy the string into the output buffer performing the required type conversions\r
     //\r
     while (Index < Count) {\r
-      ArgumentCharacter = ((*ArgumentString & 0xff) | (*(ArgumentString + 1) << 8)) & ArgumentMask;\r
+      ArgumentCharacter = ((*ArgumentString & 0xff) | (((UINT8)*(ArgumentString + 1)) << 8)) & ArgumentMask;\r
 \r
       LengthToReturn += (1 * BytesPerOutputCharacter);\r
       if ((Flags & COUNT_ONLY_NO_PRINT) == 0 && Buffer != NULL) {\r