public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
* [PATCH 1/1] ArmPkg/SemihostFs: replace SetMem with ZeroMem
@ 2023-02-15 14:37 Gerd Hoffmann
  2023-02-15 17:29 ` [edk2-devel] " Rebecca Cran
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Gerd Hoffmann @ 2023-02-15 14:37 UTC (permalink / raw)
  To: devel
  Cc: Oliver Steffen, Sami Mujawar, Leif Lindholm, Ard Biesheuvel,
	Pawel Polawski, Gerd Hoffmann, Jeremy Boone

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 <jeremy.boone@nccgroup.com>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
---
 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;
-- 
2.39.1


^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2023-03-09  9:19 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-02-15 14:37 [PATCH 1/1] ArmPkg/SemihostFs: replace SetMem with ZeroMem Gerd Hoffmann
2023-02-15 17:29 ` [edk2-devel] " Rebecca Cran
2023-02-21 14:21 ` Sami Mujawar
2023-03-09  9:16 ` Gerd Hoffmann
2023-03-09  9:18   ` Ard Biesheuvel

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox