From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by spool.mail.gandi.net (Postfix) with ESMTPS id E09B27803CC for ; Fri, 19 Jan 2024 08:22:03 +0000 (UTC) DKIM-Signature: a=rsa-sha256; bh=h//t/ryZYaN6pdTwE63nlNq+WhHj6gW/rez7q5yW8pU=; c=relaxed/simple; d=groups.io; h=ARC-Seal:ARC-Message-Signature:ARC-Authentication-Results:From:To:CC:Subject:Thread-Topic:Thread-Index:Date:Message-ID:References:In-Reply-To:Accept-Language:msip_labels:MIME-Version:Precedence:List-Subscribe:List-Help:Sender:List-Id:Mailing-List:Delivered-To:Reply-To:List-Unsubscribe-Post:List-Unsubscribe:Content-Language:Content-Type:Content-Transfer-Encoding; s=20140610; t=1705652522; v=1; b=SoL3ceQonNFtX/Xoors2kKFiGIJRdJ/tDZaXe6KLQTS0MDLnQntX/m/QSyiSUssVALhMhGKu NAbRGIMDGwlP+5gejbPAU9mu50Hhtv662CrBTDFRfOhW+I0L5aakotapZ5K7k4dzkcO3HOEBCQk UnLaoBNAUn35+cBvQb25cXi8= X-Received: by 127.0.0.2 with SMTP id pSAWYY7687511xBd1wJX3HF2; Fri, 19 Jan 2024 00:22:02 -0800 X-Received: from NAM12-DM6-obe.outbound.protection.outlook.com (NAM12-DM6-obe.outbound.protection.outlook.com [40.107.243.78]) by mx.groups.io with SMTP id smtpd.web10.17522.1705652521563867434 for ; Fri, 19 Jan 2024 00:22:01 -0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=acgDs5cIrOExsFIXzexfDxz4zqMcQCFQjq0Msro95zaEHx7ilHSO/bOEo3P6AEZUcJsLPHLMmdh9K9wZBL5f1Ajxwk/J8f9tjij7vEQ+CGj1Y7g7Kwa1tZUdewqpJq2DAzxaTe+vVJdi/UzkecazUIZ62S1Itnyp4ovXX3rNz4DZjyIX+5FAVs+0CK1Ftn0CE17bxjk/Do+IdeWCTYroQml38/6i655Lk4mx9qpP4/gofyF3cCj3rpfgwUVNK1KgjANHBabHbFx2VQJF5MrO36vw/OZ2/sUTjkLfC1xJdQW52cBEakXxRMAj+kYJLueN9r/3BIcsxwgLE6UxEBW9zw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=8kavdbhpym47Hlc0W/aEfX+JcAEQytKUEtXOLYmDxCE=; b=kVQsWcVlax0fRHCtAxI421mdt9FZv2HhMyBS7JrT/QlDoyd7TdbzlW4OL73d075F1YOw8D8LCqHUokFSshF6SmzRqWwsLGiKEaR3y28vsvNH99VywQDn5EHJhVzDU2jn0WGrWAXkM6lwL9nUed9v3Q2ROOU66hDbe9U9SYFnYiTQ6Gb9P4WufV55DflfGNCAaDdpgmHN62b5yB8LesTSrIoZCgsCspd+evutc2zcuyaBdKEe4TwjfVTYhJpyqzXYbFhIW6PdBP5mYJntP3oMAmG+SHEu5ANY444h/90Nvsxi3fDgSgiFE7/5zGh5b8nVhuXHONBJwxmhP3qykI6GSQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=amd.com; dmarc=pass action=none header.from=amd.com; dkim=pass header.d=amd.com; arc=none X-Received: from LV8PR12MB9452.namprd12.prod.outlook.com (2603:10b6:408:200::8) by IA0PR12MB8254.namprd12.prod.outlook.com (2603:10b6:208:408::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7202.24; Fri, 19 Jan 2024 08:21:59 +0000 X-Received: from LV8PR12MB9452.namprd12.prod.outlook.com ([fe80::67bd:f1b9:58a3:d2e6]) by LV8PR12MB9452.namprd12.prod.outlook.com ([fe80::67bd:f1b9:58a3:d2e6%7]) with mapi id 15.20.7202.024; Fri, 19 Jan 2024 08:21:59 +0000 From: "Chang, Abner via groups.io" To: Nickle Wang , "devel@edk2.groups.io" CC: Igor Kulchytskyy , Nick Ramirez Subject: Re: [edk2-devel] [edk2-redfish-client][PATCH] RedfishClientPkg/RedfishFeatureUtilityLib: fix wrong parameter issue Thread-Topic: [edk2-redfish-client][PATCH] RedfishClientPkg/RedfishFeatureUtilityLib: fix wrong parameter issue Thread-Index: AQHaSqADD8htfVdmJE+xbGp8L0g8QLDgy87w Date: Fri, 19 Jan 2024 08:21:58 +0000 Message-ID: References: <20240119062305.5208-1-nicklew@nvidia.com> In-Reply-To: <20240119062305.5208-1-nicklew@nvidia.com> Accept-Language: en-US, zh-CN X-MS-Has-Attach: X-MS-TNEF-Correlator: msip_labels: MSIP_Label_4342314e-0df4-4b58-84bf-38bed6170a0f_ActionId=8660a248-e017-4750-a6da-a8dd488687ee;MSIP_Label_4342314e-0df4-4b58-84bf-38bed6170a0f_ContentBits=0;MSIP_Label_4342314e-0df4-4b58-84bf-38bed6170a0f_Enabled=true;MSIP_Label_4342314e-0df4-4b58-84bf-38bed6170a0f_Method=Standard;MSIP_Label_4342314e-0df4-4b58-84bf-38bed6170a0f_Name=General;MSIP_Label_4342314e-0df4-4b58-84bf-38bed6170a0f_SetDate=2024-01-19T08:21:40Z;MSIP_Label_4342314e-0df4-4b58-84bf-38bed6170a0f_SiteId=3dd8961f-e488-4e60-8e11-a82d994e183d; x-ms-publictraffictype: Email x-ms-traffictypediagnostic: LV8PR12MB9452:EE_|IA0PR12MB8254:EE_ x-ms-office365-filtering-correlation-id: 101f48c5-152c-4ab8-2e4d-08dc18c7b4b6 x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam-message-info: sKGHYQ0V7/AlyaKZ4DHylTsB3dPbpzmuJQHXnNBi/SmzbxLwyAtuviQ21+2rEkm7rW1Q7TWZ8+TooyJQZKGuc/LJkeofRQBen62xScszAzRw21vvyLodMAz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kSiDncHq0CCWqk1nqgB3y?= =?us-ascii?Q?QxHFANEcUzDwSc46JeE0utzgxpwUBv1pSTYfNsnasMMIDh6xaA4v+w5k9I8V?= =?us-ascii?Q?d7LumaXtFFkpFWuVYW99/dM87LLplSTLU0/um5dIK2GlUXseHdN6tZ3oGq6n?= =?us-ascii?Q?PArnNRgb9zna7T6Ok5WPdBV22TzwYMQA1+ZHGiRsBaPiwkCEU1zYF76S+KBL?= =?us-ascii?Q?dPRUnmVuy63ihduhS7CZXWTVS0Yvrw4O0WAXSufmSbFhTg48lJ0//s0v8eBN?= =?us-ascii?Q?E2YuV/xtiVefYMUOhSe1w0qQq/FAgIg7Oima1W7mZu2R7sq+W0T/l4lGHdS5?= =?us-ascii?Q?Mnz9r4BedBtNgZlPde8=3D?= MIME-Version: 1.0 X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: LV8PR12MB9452.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 101f48c5-152c-4ab8-2e4d-08dc18c7b4b6 X-MS-Exchange-CrossTenant-originalarrivaltime: 19 Jan 2024 08:21:58.8864 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: f+fgskNIGd1NNF3MlQNls7+9Ejd7VksulT43ixLzZvbhssY3QhSQWg+CQumefc3kOWgBDwqvxLURUw1aUrYsAw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: IA0PR12MB8254 Precedence: Bulk 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,abner.chang@amd.com List-Unsubscribe-Post: List-Unsubscribe=One-Click List-Unsubscribe: X-Gm-Message-State: w1Zg65P2hTQG9rr0rzw3yV2Mx7686176AA= Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable X-GND-Status: LEGIT Authentication-Results: spool.mail.gandi.net; dkim=pass header.d=groups.io header.s=20140610 header.b=SoL3ceQo; arc=reject ("signature check failed: fail, {[1] = sig:microsoft.com:reject}"); dmarc=none; spf=pass (spool.mail.gandi.net: domain of bounce@groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce@groups.io [AMD Official Use Only - General] Reviewed-by: Abner Chang > -----Original Message----- > From: Nickle Wang > Sent: Friday, January 19, 2024 2:23 PM > To: devel@edk2.groups.io > Cc: Chang, Abner ; Igor Kulchytskyy > ; Nick Ramirez > Subject: [edk2-redfish-client][PATCH] > RedfishClientPkg/RedfishFeatureUtilityLib: fix wrong parameter issue > > Caution: This message originated from an External Source. Use proper caut= ion > when opening attachments, clicking links, or responding. > > > Third parameter of AsciiStrToUnicodeStrS is the number of character in > destination buffer, not the size in byte of destination buffer. This > creates failure of converting ASCII string to Unicode string in Redfish > application while getting Location field in HTTP header. > > Signed-off-by: Nickle Wang > Cc: Abner Chang > Cc: Igor Kulchytskyy > Cc: Nick Ramirez > --- > .../RedfishFeatureUtilityLib.c | 10 ++++++---- > 1 file changed, 6 insertions(+), 4 deletions(-) > > diff --git > a/RedfishClientPkg/Library/RedfishFeatureUtilityLib/RedfishFeatureUtility= Lib. > c > b/RedfishClientPkg/Library/RedfishFeatureUtilityLib/RedfishFeatureUtility= Lib. > c > index a10fa4832..e14944710 100644 > --- > a/RedfishClientPkg/Library/RedfishFeatureUtilityLib/RedfishFeatureUtility= Lib. > c > +++ > b/RedfishClientPkg/Library/RedfishFeatureUtilityLib/RedfishFeatureUtility= Lib. > c > @@ -355,7 +355,7 @@ StrUnicodeToAscii ( > > Status =3D UnicodeStrToAsciiStrS (UnicodeStr, AsciiStr, AsciiStrSize); > if (EFI_ERROR (Status)) { > - DEBUG ((DEBUG_ERROR, "UnicodeStrToAsciiStrS failed: %r\n", Status)); > + DEBUG ((DEBUG_ERROR, "%a: UnicodeStrToAsciiStrS failed: %r\n", > __func__, Status)); > FreePool (AsciiStr); > return NULL; > } > @@ -380,21 +380,23 @@ StrAsciiToUnicode ( > { > EFI_STRING UnicodeStr; > UINTN UnicodeStrSize; > + UINTN InputStrSize; > EFI_STATUS Status; > > if (IS_EMPTY_STRING (AsciiStr)) { > return NULL; > } > > - UnicodeStrSize =3D (AsciiStrLen (AsciiStr) + 1) * sizeof (CHAR16); > + InputStrSize =3D AsciiStrSize (AsciiStr); > + UnicodeStrSize =3D InputStrSize * sizeof (CHAR16); > UnicodeStr =3D AllocatePool (UnicodeStrSize); > if (UnicodeStr =3D=3D NULL) { > return NULL; > } > > - Status =3D AsciiStrToUnicodeStrS (AsciiStr, UnicodeStr, UnicodeStrSize= ); > + Status =3D AsciiStrToUnicodeStrS (AsciiStr, UnicodeStr, InputStrSize); > if (EFI_ERROR (Status)) { > - DEBUG ((DEBUG_ERROR, "t failed: %r\n", Status)); > + DEBUG ((DEBUG_ERROR, "%a: AsciiStrToUnicodeStrS failed: %r\n", > __func__, Status)); > FreePool (UnicodeStr); > return NULL; > } > -- > 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 (#114030): https://edk2.groups.io/g/devel/message/114030 Mute This Topic: https://groups.io/mt/103825503/7686176 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-