From nobody Mon Feb 9 19:05:22 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) client-ip=66.175.222.108; envelope-from=bounce+27952+85749+1787277+3901457@groups.io; helo=mail02.groups.io; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+85749+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1642416776; cv=none; d=zohomail.com; s=zohoarc; b=k1UXHu9mv4/72+C66AZCnROk8DpnPHLByyn+n4FWg5u9cTZJnLpYC0cpTIx2CR8NnanUpS0QkI2F+flTdp40Fi2JzKniF4ClPsXJYFY3shcCT/zaaMZ1h2WQeX+Hgf7OuEzXUjN1N/cHQuLROFbqgI+3EnxV74EEljj2VdCtgJM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1642416776; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:References:Sender:Subject:To; bh=O+Ovyi+CwilBpoyRgEv0vRhfdc8/DPNXZ5OEzuKVmps=; b=J+GB8qjAhZ3IDOLPoK3+U0GhTr/trljfpopRgHw0sQF4dXf47AQV8+MoU8KSGPWh4+4ViSWj7Fw+w4AsrHTXqmCcyjmG52l+sz1ZUoJgD3UtqhHnBLE5ZQTW88Hb+cKSvgoBC+ivW0YjxK5pIBPPE18IPeK8+7nIHgxwcdWerGQ= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+85749+1787277+3901457@groups.io; dmarc=fail header.from= (p=none dis=none) Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by mx.zohomail.com with SMTPS id 1642416776526916.5200794404878; Mon, 17 Jan 2022 02:52:56 -0800 (PST) Return-Path: X-Received: by 127.0.0.2 with SMTP id XDjbYY1788612xK41zjUJhfg; Mon, 17 Jan 2022 02:52:56 -0800 X-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.web08.9718.1642416775441302908 for ; Mon, 17 Jan 2022 02:52:55 -0800 X-Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-549-nXl_xpkpMVCVFbHY1TtEhw-1; Mon, 17 Jan 2022 05:52:51 -0500 X-MC-Unique: nXl_xpkpMVCVFbHY1TtEhw-1 X-Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 144A11937FC0; Mon, 17 Jan 2022 10:52:50 +0000 (UTC) X-Received: from sirius.home.kraxel.org (unknown [10.39.192.49]) by smtp.corp.redhat.com (Postfix) with ESMTPS id EE62E7AB4B; Mon, 17 Jan 2022 10:52:45 +0000 (UTC) X-Received: by sirius.home.kraxel.org (Postfix, from userid 1000) id 629B8180063D; Mon, 17 Jan 2022 11:52:34 +0100 (CET) From: "Gerd Hoffmann" To: devel@edk2.groups.io Cc: Xiaoyu Lu , Pawel Polawski , Guomin Jiang , Jiewen Yao , Jian J Wang , Gerd Hoffmann Subject: [edk2-devel] [PATCH 7/8] CryptoPkg/CrtLibSupport: fix strcpy Date: Mon, 17 Jan 2022 11:52:33 +0100 Message-Id: <20220117105234.1981719-8-kraxel@redhat.com> In-Reply-To: <20220117105234.1981719-1-kraxel@redhat.com> References: <20220117105234.1981719-1-kraxel@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Precedence: Bulk List-Unsubscribe: List-Subscribe: List-Help: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Reply-To: devel@edk2.groups.io,kraxel@redhat.com X-Gm-Message-State: dbrNT5KkODFECWWVWCcw028qx1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1642416776; bh=3XLXwvB/VD7oWDDhfP+6hDr/BtJmHVYGbaCmXvpGfGA=; h=Cc:Content-Type:Date:From:Reply-To:Subject:To; b=v6jHJgXn6/R8HcgwFmQeYWP2rMycZVZbBCLLj+SGK+tid/+5a/CSfNdcBlJRKI0ADoA YYYoW0NHL4EhvL9YtbOBdXkMAbcrsAyNEifw5EW9DpXPxC/Uj+rbYiRJvwJH/frLvR4+w /rZWDkL2G9HJt+8bMf8aMcTmedZ4skc5blo= X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1642416777463100001 Content-Type: text/plain; charset="utf-8" strcpy() returns a pointer to the destination string, AsciiStrCpyS() does not. So a simple #define does not work. Create a inline function instead. Signed-off-by: Gerd Hoffmann --- CryptoPkg/Library/Include/CrtLibSupport.h | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/CryptoPkg/Library/Include/CrtLibSupport.h b/CryptoPkg/Library/= Include/CrtLibSupport.h index fd8e8e1a938b..981ed3097b24 100644 --- a/CryptoPkg/Library/Include/CrtLibSupport.h +++ b/CryptoPkg/Library/Include/CrtLibSupport.h @@ -395,6 +395,16 @@ inet_pton ( void * ); =20 +static inline char * +strcpy ( + char *restrict strDest, + const char *strSource + ) +{ + AsciiStrCpyS (strDest, MAX_STRING_SIZE, strSource); + return strDest; +} + // // Macros that directly map functions to BaseLib, BaseMemoryLib, and Debug= Lib functions // @@ -404,7 +414,6 @@ inet_pton ( #define memcmp(buf1, buf2, count) (int)(CompareMem(buf1,buf2,(UI= NTN)(count))) #define memmove(dest, source, count) CopyMem(dest,source,(UINTN)(co= unt)) #define strlen(str) (size_t)(AsciiStrnLenS(str,MAX= _STRING_SIZE)) -#define strcpy(strDest, strSource) AsciiStrCpyS(strDest,MAX_STRIN= G_SIZE,strSource) #define strncpy(strDest, strSource, count) AsciiStrnCpyS(strDest,MAX_STRI= NG_SIZE,strSource,(UINTN)count) #define strcat(strDest, strSource) AsciiStrCatS(strDest,MAX_STRIN= G_SIZE,strSource) #define strncmp(string1, string2, count) (int)(AsciiStrnCmp(string1,str= ing2,(UINTN)(count))) --=20 2.34.1 -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#85749): https://edk2.groups.io/g/devel/message/85749 Mute This Topic: https://groups.io/mt/88481533/1787277 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-