From nobody Mon Feb 9 21:38:19 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+88699+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+88699+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1649676321; cv=none; d=zohomail.com; s=zohoarc; b=MTichC+fHlQ9zC5WN9+iQr9ATED7BnJmlz7bYJPaa7lHlf73Z1zQZ2APLkXLa4Opdc2qqHsiC3fOrnj/ssyt2a7d6pHMuMsyur0B8+eBBj6X5ER2WEJJU1w6jGEW9IdtmjzxjgR3ITv97QLBbe3tAiL9eKfUyIJVhiKfk7rdrJU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1649676321; 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=F/u89cqE7vxsDpT0o6oZRnPgfwZbLw66y1aEUKMLrCk=; b=gwJ/qpwPvIw4pWCtdli6e2vRTeFIcuwgClSae4QJsv3AQKA7zCqvystfVOQo06+j03Q+/J9i3cRSA5MvKQhktbPy3J7iGxXn7gjm3BGC7Enks2UseikWZYNz7cA1i6DPf0nD5qDsL0huIMD7iHgNKr96pO7a2aBYFI5eXAkUpks= 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+88699+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 1649676321137668.6575220411805; Mon, 11 Apr 2022 04:25:21 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id mtUYYY1788612xh0R0XflG8c; Mon, 11 Apr 2022 04:25:20 -0700 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.web11.28353.1649676319932114781 for ; Mon, 11 Apr 2022 04:25:20 -0700 X-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-541-QZy2RAIKOXCNhuMPO6V47g-1; Mon, 11 Apr 2022 07:25:16 -0400 X-MC-Unique: QZy2RAIKOXCNhuMPO6V47g-1 X-Received: from smtp.corp.redhat.com (int-mx09.intmail.prod.int.rdu2.redhat.com [10.11.54.9]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 96AB6833964; Mon, 11 Apr 2022 11:25:15 +0000 (UTC) X-Received: from sirius.home.kraxel.org (unknown [10.39.192.9]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 6615A42D3A1; Mon, 11 Apr 2022 11:25:15 +0000 (UTC) X-Received: by sirius.home.kraxel.org (Postfix, from userid 1000) id 7C9191800908; Mon, 11 Apr 2022 13:24:57 +0200 (CEST) From: "Gerd Hoffmann" To: devel@edk2.groups.io Cc: Oliver Steffen , Pawel Polawski , Jian J Wang , Xiaoyu Lu , Jiewen Yao , Guomin Jiang , Gerd Hoffmann , Jiewen Yao Subject: [edk2-devel] [PATCH v3 7/8] CryptoPkg/CrtLibSupport: fix strcpy Date: Mon, 11 Apr 2022 13:24:56 +0200 Message-Id: <20220411112457.506101-8-kraxel@redhat.com> In-Reply-To: <20220411112457.506101-1-kraxel@redhat.com> References: <20220411112457.506101-1-kraxel@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.85 on 10.11.54.9 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: P5MtgFXEDpyJiRMqLMdyQ0rRx1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1649676320; bh=P27AlurSKl6RgjZUZqhbQWVt2z97QxPkkPsS07Vs4Yg=; h=Cc:Content-Type:Date:From:Reply-To:Subject:To; b=CtsntMvPvIm+Uvw56RyDYGHC3Hrg3kZLwBZ3/LyGRsb61erK1vSszShUawsrUdIDXcZ fqrRwJxABU3eR8YDn3vI7S4/4Zt4EW7uNJ33RuCr2mLl6JKE0dkR+DX1mUN02ccB/Yrk4 mv/hpGOrto9VunAShau8b9jlNQpPfn81M1E= X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1649676321413100013 Content-Type: text/plain; charset="utf-8"; x-default="true" strcpy() returns a pointer to the destination string, AsciiStrCpyS() does not. So a simple #define does not work. Create a function instead. Signed-off-by: Gerd Hoffmann Reviewed-by: Jiewen Yao --- CryptoPkg/Library/Include/CrtLibSupport.h | 7 ++++++- CryptoPkg/Library/BaseCryptLib/SysCall/CrtWrapper.c | 10 ++++++++++ 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/CryptoPkg/Library/Include/CrtLibSupport.h b/CryptoPkg/Library/= Include/CrtLibSupport.h index 287d7f76bfb3..bdc2654b6eef 100644 --- a/CryptoPkg/Library/Include/CrtLibSupport.h +++ b/CryptoPkg/Library/Include/CrtLibSupport.h @@ -395,6 +395,12 @@ inet_pton ( void * ); =20 +char * +strcpy ( + char *restrict strDest, + const char *strSource + ); + // // Macros that directly map functions to BaseLib, BaseMemoryLib, and Debug= Lib functions // @@ -404,7 +410,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))) diff --git a/CryptoPkg/Library/BaseCryptLib/SysCall/CrtWrapper.c b/CryptoPk= g/Library/BaseCryptLib/SysCall/CrtWrapper.c index bac477da070b..6fcbe5885e7b 100644 --- a/CryptoPkg/Library/BaseCryptLib/SysCall/CrtWrapper.c +++ b/CryptoPkg/Library/BaseCryptLib/SysCall/CrtWrapper.c @@ -265,6 +265,16 @@ strcspn ( return Count; } =20 +char * +strcpy ( + char *restrict strDest, + const char *strSource + ) +{ + AsciiStrCpyS (strDest, MAX_STRING_SIZE, strSource); + return strDest; +} + // // -- Character Classification Routines -- // --=20 2.35.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 (#88699): https://edk2.groups.io/g/devel/message/88699 Mute This Topic: https://groups.io/mt/90392492/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-