From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by mx.groups.io with SMTP id smtpd.web11.9151.1678353403789148722 for ; Thu, 09 Mar 2023 01:16:43 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=RmDoZJYK; spf=pass (domain: redhat.com, ip: 170.10.129.124, mailfrom: kraxel@redhat.com) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1678353402; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=hLYOp/i0jXMv0/7i1X9DPOhH8XYR/f+fD11CRpDEX/4=; b=RmDoZJYKqf4EwC95qjLhqFsHx3bV2gqTSGdVAgx5vb0dqyAobhtFrc+YVX3KHv7IaBzUGY 3UtOFZo5rQ5Nbb+68a15sxU39wTV0LA7lpqaM4yA/FkRtKnq9Y9mjwJcVd2Ah7Tb3QnSrM +L7fFKNq2w70J11Q6fC3B6BVOkv6Ars= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-369-pYNZT4gRPcKWdvNkMQVG7w-1; Thu, 09 Mar 2023 04:16:39 -0500 X-MC-Unique: pYNZT4gRPcKWdvNkMQVG7w-1 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.rdu2.redhat.com [10.11.54.4]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id AA9E785CCE3; Thu, 9 Mar 2023 09:16:38 +0000 (UTC) Received: from sirius.home.kraxel.org (unknown [10.39.192.39]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 2B0D82026D4B; Thu, 9 Mar 2023 09:16:38 +0000 (UTC) Received: by sirius.home.kraxel.org (Postfix, from userid 1000) id AC1FD1800082; Thu, 9 Mar 2023 10:16:36 +0100 (CET) Date: Thu, 9 Mar 2023 10:16:36 +0100 From: "Gerd Hoffmann" To: devel@edk2.groups.io Cc: Oliver Steffen , Sami Mujawar , Leif Lindholm , Ard Biesheuvel , Pawel Polawski , Jeremy Boone Subject: Re: [PATCH 1/1] ArmPkg/SemihostFs: replace SetMem with ZeroMem Message-ID: <20230309091636.5kk3hlysdirhfyrh@sirius.home.kraxel.org> References: <20230215143732.676580-1-kraxel@redhat.com> MIME-Version: 1.0 In-Reply-To: <20230215143732.676580-1-kraxel@redhat.com> X-Scanned-By: MIMEDefang 3.1 on 10.11.54.4 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Ping. Two reviews and the freeze is over. Merge this now? On Wed, Feb 15, 2023 at 03:37:32PM +0100, Gerd Hoffmann wrote: > 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 > --- > 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 > --