From nobody Mon Feb 9 01:35:10 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+88629+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+88629+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1649416606; cv=none; d=zohomail.com; s=zohoarc; b=jhOSQJ98u2c+VbuOpAUWXMISoldn/jKo18+gO4YxBzRpy9DRXvhcSvDM3REUOPiLJGlJePE7ON0Y5kMxv0tHWS1O1CPoNAciVUv2NK8e2gLt3EKRl8duXPO+nCORYrHx9bBKWwjGDOz47JihHUeNynqW6g6RoSZxObaa8QWSE0s= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1649416606; 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=CfAN5CNCrLoY8XKKBacgaooHEKSbQNW7ucmdPro+Vd0=; b=jGfiQMBPanvRC1gEJfeJ7uNhpasSaw7S6HO8B/vEGt2bfjvOww9cb070R5c3XjdYwhOmxySCH7v2Uc5LHhUIzbFkHVDJa2PL/G+UE5FjkafnRXtwzxs8MkrphN/ZEENIyASqpdeVUq6M36UeihEZfK4ZE8STYxvvz9DB6zEjO7M= 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+88629+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 1649416606431629.3207850290332; Fri, 8 Apr 2022 04:16:46 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id SOOFYY1788612xywJxr7jpv7; Fri, 08 Apr 2022 04:16:46 -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.web09.4519.1649416605169449150 for ; Fri, 08 Apr 2022 04:16:45 -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-471-uPDatWFhNXy7wtL2GR_uiw-1; Fri, 08 Apr 2022 07:16:40 -0400 X-MC-Unique: uPDatWFhNXy7wtL2GR_uiw-1 X-Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 03E5880B710; Fri, 8 Apr 2022 11:16:40 +0000 (UTC) X-Received: from sirius.home.kraxel.org (unknown [10.39.192.9]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 5CB7B7AEA; Fri, 8 Apr 2022 11:16:32 +0000 (UTC) X-Received: by sirius.home.kraxel.org (Postfix, from userid 1000) id CF88B180098C; Fri, 8 Apr 2022 13:16:22 +0200 (CEST) From: "Gerd Hoffmann" To: devel@edk2.groups.io Cc: Oliver Steffen , Jiewen Yao , Guomin Jiang , Jian J Wang , Xiaoyu Lu , Pawel Polawski , Gerd Hoffmann Subject: [edk2-devel] [PATCH v2 7/8] CryptoPkg/CrtLibSupport: fix strcpy Date: Fri, 8 Apr 2022 13:16:21 +0200 Message-Id: <20220408111622.3519517-8-kraxel@redhat.com> In-Reply-To: <20220408111622.3519517-1-kraxel@redhat.com> References: <20220408111622.3519517-1-kraxel@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.11.54.5 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: OOiS9yYd8JcyDXqrNDVbTdZ9x1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1649416606; bh=BiB9J7FYkp5R6Ypg67ZSugpHYGgLdmXvvHNZ99+uA0I=; h=Cc:Content-Type:Date:From:Reply-To:Subject:To; b=AzQ9kSAuuYa+gbPldxhiLiwkHEgMTwISIcmmkmSK/GGL/gTge7Mi6yJik5sjpNRSxwk WZ3GWn0d3SC94KHc/J8QkpcVRBXUbLDSQKsHdThdPTiNXbWLbWoJLMPmVoiVfzVSvvl4E Yj4Eh/SODb01mQcjmBaETt+jhmb6mhuJ1F4= X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1649416606939100011 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 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 287d7f76bfb3..7c1bc7755b1c 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.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 (#88629): https://edk2.groups.io/g/devel/message/88629 Mute This Topic: https://groups.io/mt/90333060/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-