From bf32c2d61f3e13e8e0f33fce431376812c99da81 Mon Sep 17 00:00:00 2001 From: Pierre Gondois Date: Wed, 2 Oct 2024 11:56:48 +0200 Subject: ArmPkg/SemihostFs: StrSize() cannot return 0 StrSize() account the terminating NULL character and cannot return 0. Replace StrSize() StrLen(). BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=4859 Reported-by: Tormod Volden Signed-off-by: Pierre Gondois --- 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 9cc9ed7d36..7703e52fe3 100644 --- a/ArmPkg/Filesystem/SemihostFs/Arm/SemihostFs.c +++ b/ArmPkg/Filesystem/SemihostFs/Arm/SemihostFs.c @@ -1158,7 +1158,7 @@ FileSetInfo ( Buffer = SystemInfo->VolumeLabel; - if (StrSize (Buffer) > 0) { + if (StrLen (Buffer) > 0) { VolumeLabel = AllocateCopyPool (StrSize (Buffer), Buffer); if (VolumeLabel != NULL) { FreePool (mSemihostFsLabel); -- cgit