MdePkg/UefiDebugLibConOut: Pass the correct buffer size
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=2302 The second argument of "UnicodeVSPrintAsciiFormat" is "BufferSize", which takes the size of the buffer in bytes. Replace the currently used MAX_DEBUG_MESSAGE_LENGTH usage, which is the buffer's length, with the actual buffer size. Cc: Michael D Kinney <michael.d.kinney@intel.com> Cc: Liming Gao <liming.gao@intel.com> Signed-off-by: Marvin Haeuser <mhaeuser@outlook.de> Reviewed-by: Liming Gao <liming.gao@intel.com>
This commit is contained in:
		
				
					committed by
					
						
						Liming Gao
					
				
			
			
				
	
			
			
			
						parent
						
							e2fc508128
						
					
				
				
					commit
					5ae6c993ab
				
			@@ -104,9 +104,9 @@ DebugPrintMarker (
 | 
				
			|||||||
    // Convert the DEBUG() message to a Unicode String
 | 
					    // Convert the DEBUG() message to a Unicode String
 | 
				
			||||||
    //
 | 
					    //
 | 
				
			||||||
    if (BaseListMarker == NULL) {
 | 
					    if (BaseListMarker == NULL) {
 | 
				
			||||||
      UnicodeVSPrintAsciiFormat (Buffer, MAX_DEBUG_MESSAGE_LENGTH,  Format, VaListMarker);
 | 
					      UnicodeVSPrintAsciiFormat (Buffer, sizeof (Buffer), Format, VaListMarker);
 | 
				
			||||||
    } else {
 | 
					    } else {
 | 
				
			||||||
      UnicodeBSPrintAsciiFormat (Buffer, MAX_DEBUG_MESSAGE_LENGTH,  Format, BaseListMarker);
 | 
					      UnicodeBSPrintAsciiFormat (Buffer, sizeof (Buffer), Format, BaseListMarker);
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user