From 2fccd1f153e1b7146d6fe9d9f8cfaeabdf636c44 Mon Sep 17 00:00:00 2001 From: Gerd Hoffmann Date: Wed, 15 Feb 2023 15:37:32 +0100 Subject: [PATCH] ArmPkg/SemihostFs: replace SetMem with ZeroMem SetMem arguments 2+3 are in the wrong order, resulting in the call having no effect because Length is zero. Fix this by using ZeroMem instead. Bugzilla: https://bugzilla.tianocore.org/show_bug.cgi?id=4205 Reported-by: Jeremy Boone Signed-off-by: Gerd Hoffmann Reviewed-by: Rebecca Cran Reviewed-by: Sami Mujawar --- ArmPkg/Filesystem/SemihostFs/Arm/SemihostFs.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ArmPkg/Filesystem/SemihostFs/Arm/SemihostFs.c b/ArmPkg/Filesystem/SemihostFs/Arm/SemihostFs.c index 39a30533ee57..9cc9ed7d3637 100644 --- a/ArmPkg/Filesystem/SemihostFs/Arm/SemihostFs.c +++ b/ArmPkg/Filesystem/SemihostFs/Arm/SemihostFs.c @@ -574,7 +574,7 @@ ExtendFile ( } Remaining = Size; - SetMem (WriteBuffer, 0, sizeof (WriteBuffer)); + ZeroMem (WriteBuffer, sizeof (WriteBuffer)); while (Remaining > 0) { WriteNb = MIN (Remaining, sizeof (WriteBuffer)); WriteSize = WriteNb;