mirror of https://github.com/acidanthera/audk.git
Fix memory overflow.
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@7203 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
parent
dc4dc1ded8
commit
d6039b1d6e
|
@ -77,11 +77,17 @@ BasePrintLibFillBuffer (
|
|||
)
|
||||
{
|
||||
INTN Index;
|
||||
|
||||
for (Index = 0; Index < Length && Buffer < EndBuffer; Index++) {
|
||||
*Buffer = (CHAR8) Character;
|
||||
*(Buffer + 1) = (CHAR8) (Character >> 8);
|
||||
Buffer += Increment;
|
||||
if(Increment != 1) {
|
||||
for (Index = 0; Index < Length && Buffer < EndBuffer; Index++) {
|
||||
*Buffer = (CHAR8) Character;
|
||||
*(Buffer + 1) = (CHAR8) (Character >> 8);
|
||||
}
|
||||
Buffer += Increment;
|
||||
} else {
|
||||
for (Index = 0; Index < Length && Buffer < EndBuffer; Index++) {
|
||||
*Buffer = (CHAR8) Character;
|
||||
}
|
||||
Buffer += Increment;
|
||||
}
|
||||
return Buffer;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue