From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from NAM12-MW2-obe.outbound.protection.outlook.com (NAM12-MW2-obe.outbound.protection.outlook.com [40.107.244.48]) by mx.groups.io with SMTP id smtpd.web11.17854.1683872750558675486 for ; Thu, 11 May 2023 23:25:50 -0700 Authentication-Results: mx.groups.io; dkim=fail reason="body hash did not verify" header.i=@nvidia.com header.s=selector2 header.b=hk6cZ5hV; spf=permerror, err=parse error for token &{10 18 %{i}._ip.%{h}._ehlo.%{d}._spf.vali.email}: invalid domain name (domain: nvidia.com, ip: 40.107.244.48, mailfrom: nicklew@nvidia.com) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=UlNxqp5EiU2b9ENMdTPQvTmojH6+hR40pCUaJrMXAPHH1FUmIxKlQmWxZ/71jFnr4RCpHdpque495C/ibZtXsgl2a5InLTvX+aUZniX9Hk2BzbZ32nX47bBrUr27sXVtHRnWwX4w2F/7Tq1PVpwGn23Omo+tBcNDvRRbTnBchKMtYDCgsouFCJFVTFTdR4MI7RRXsnU+cqK0Xddw3ZbGIToU/dBxwbqQA6xHD3divDza7EYiSBUcKKckMarOKDdmPz/jFchGDuhqUN+TeCQ5Hw3W1lkeXQQYB/DutvLV071YyVPJ9niMNOjJNOdUR8HhWa5i5N/LjYFZmb/rPXvluA== 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=0GgRt17eMKUYJDI2c9L/9G3dL1lIuTD8T3FuQCWy438=; b=DAyet8jJYJsB7sKalYki3nNCKJZAFHa0yuAPKa1R3EBKarcn+nnPNPZMe9f4kX/DtwyBZkQqQdtDonAB5vqEF2j1JgcgFwYOhS+idF79LaimfcjVcViKW0PmmBZa9VSushT21dF5zbzxk+wEL0lJTNT/nLa/UHXhnc1BvgkL2cfjSmvdq6ZI7jXG8In0KigOQpKKaRFkpEqSZWaJa48d7tms251JMYf5X20ZlIBxzwhurF+7a9Zq3jvx4PPaWhR8zBEL5liPbuL1d3w9sgOqYXQ+zlh72WpQM0kDE4jMQDybaiDEpc+flj4E2SYjcgvfAzN7jtzaJ7taA56xxQ9d+A== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.118.233) smtp.rcpttodomain=edk2.groups.io smtp.mailfrom=nvidia.com; dmarc=pass (p=reject sp=reject pct=100) action=none header.from=nvidia.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Nvidia.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=0GgRt17eMKUYJDI2c9L/9G3dL1lIuTD8T3FuQCWy438=; b=hk6cZ5hViNrOp/WC3YDbVJSaPOXuDAS/Oxxet9EFhtk8okSxqO5OHjHZxsumfG3YwGVu4gH9DTNbnTStNR8jMQLTesLRxxWMt1yXLXbH1kBW0nlNZET3nxJNw1QJoUmbDU5/x141ZcMhDFJK7jV9Lcdg3iqzfevfAuTvkkx9tsChUuC3ucHgYMeY9XGteRAOwNx1xHf6a5QD0YLP9fL3GUuKQvtqEipD6KLo70A4Z14dzUBkht5ObOZcp5J3TeVSGEOonbCMWpg9sWVkvmPDNxHqut3HBy9lUAIWnBlV1XtS+bElKZsh2tjLlHFE1tXTPreNlvhX0qakWiU/3t0sbA== Received: from BN9P222CA0015.NAMP222.PROD.OUTLOOK.COM (2603:10b6:408:10c::20) by PH0PR12MB8125.namprd12.prod.outlook.com (2603:10b6:510:293::6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6387.18; Fri, 12 May 2023 06:25:48 +0000 Received: from BN8NAM11FT116.eop-nam11.prod.protection.outlook.com (2603:10b6:408:10c:cafe::f6) by BN9P222CA0015.outlook.office365.com (2603:10b6:408:10c::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6387.22 via Frontend Transport; Fri, 12 May 2023 06:25:47 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 216.228.118.233) smtp.mailfrom=nvidia.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=nvidia.com; Received-SPF: Pass (protection.outlook.com: domain of nvidia.com designates 216.228.118.233 as permitted sender) receiver=protection.outlook.com; client-ip=216.228.118.233; helo=mail.nvidia.com; pr=C Received: from mail.nvidia.com (216.228.118.233) by BN8NAM11FT116.mail.protection.outlook.com (10.13.176.67) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6387.24 via Frontend Transport; Fri, 12 May 2023 06:25:47 +0000 Received: from drhqmail201.nvidia.com (10.126.190.180) by mail.nvidia.com (10.127.129.6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.5; Thu, 11 May 2023 23:25:31 -0700 Received: from drhqmail202.nvidia.com (10.126.190.181) by drhqmail201.nvidia.com (10.126.190.180) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.37; Thu, 11 May 2023 23:25:31 -0700 Received: from NV-CL38DL3.nvidia.com (10.127.8.9) by mail.nvidia.com (10.126.190.181) with Microsoft SMTP Server id 15.2.986.37 via Frontend Transport; Thu, 11 May 2023 23:25:30 -0700 From: "Nickle Wang" To: CC: Abner Chang , Igor Kulchytskyy Subject: [edk2-redfish-client][PATCH] RedfishClientPkg/ConverterLib: Fix empty string value issue Date: Fri, 12 May 2023 14:25:29 +0800 Message-ID: <20230512062529.3944-1-nicklew@nvidia.com> X-Mailer: git-send-email 2.17.1 MIME-Version: 1.0 Return-Path: nicklew@nvidia.com X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: BN8NAM11FT116:EE_|PH0PR12MB8125:EE_ X-MS-Office365-Filtering-Correlation-Id: e2ea9a22-b08d-45a7-f636-08db52b1b995 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: O5w5hQ0Gsti9bwlmZfoJQ/Nu4QiAErUsSn3WPqTt1EB0UtE8NDWwLtdBN77q/tHldRybGIcua0PuIlaTfrpBI0n4vblQMW5/L0PcNrTxlJ9alUJdPAknqEcvhPaxBw9DlIfLyPK27oLAhj0eMmobp8qztC1wKm9oZbc2zdThDzn5ehjL7bHWVeuqGRXKi6WMRO6PRJ7XGX+PyScNwEz3I9mK1SP2hHMW02dGBInboW90XPdRuNUkJs62n2PgyUlRLsCBXqZzM010il3LmwoZmATeHC+aa29my3v0WjM0DJFeV+qrSbCuRVSKq0Fx9gSPR6flkH85qclJVUm9iFuhxuHD0lG7ADktP/VY6eVkjs0+B4M08EYFWAL4EgDQi9BO3sMd9yEYOsr1gveg68fFIoKKyyRMeLKhAHWSgQzCtpNqklSnGy66a+NN2zXsQAVxkMEyexUIEuyNsV+K/zyEIGWex0qtWclzlp+ehZSZOoIBOO5iJUgEgU+8A+75YkzeQ9opN4Du/9V5Qkhq+NQ5peUByic4KruUyZkGFM1SWBTL5GzYH9RhnGPAiMbOmhXKcXlolvNIgmijVfieFb69nIxxgR8/hlQtPkF99+69ysQ9Rl2XNn0w4ml3g9xb70O9csgGpuPq1nD+OPHSx554VMrEGhA3dFnP+9MFaiqEOiPEsfOAg7Z69xHIyXQ2oamqxQcOENRlWDwOxtnNseND9g2HWzkJP5JXiopKuZ7L32h9dYZfy/4XB1frm0+R/8JN X-Forefront-Antispam-Report: CIP:216.228.118.233;CTRY:US;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:mail.nvidia.com;PTR:dc7edge2.nvidia.com;CAT:NONE;SFS:(13230028)(4636009)(136003)(39860400002)(396003)(346002)(376002)(451199021)(36840700001)(46966006)(40470700004)(83380400001)(40460700003)(2616005)(426003)(186003)(336012)(2906002)(4744005)(36860700001)(36756003)(86362001)(82310400005)(356005)(7636003)(82740400003)(40480700001)(47076005)(5660300002)(8676002)(8936002)(70206006)(478600001)(70586007)(6916009)(4326008)(316002)(7696005)(41300700001)(1076003)(26005)(54906003);DIR:OUT;SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 12 May 2023 06:25:47.7325 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: e2ea9a22-b08d-45a7-f636-08db52b1b995 X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=43083d15-7273-40c1-b7db-39efd9ccc17a;Ip=[216.228.118.233];Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: BN8NAM11FT116.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH0PR12MB8125 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain allocateDuplicateStr() will not copy input string when input string is empty string. It returns NULL pointer and creates assertion in application driver. Signed-off-by: Nickle Wang Cc: Abner Chang Cc: Igor Kulchytskyy --- RedfishClientPkg/ConverterLib/src/RedfishCsCommon.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/RedfishClientPkg/ConverterLib/src/RedfishCsCommon.c b/RedfishC= lientPkg/ConverterLib/src/RedfishCsCommon.c index 964904a2..02fcb2b2 100644 --- a/RedfishClientPkg/ConverterLib/src/RedfishCsCommon.c +++ b/RedfishClientPkg/ConverterLib/src/RedfishCsCommon.c @@ -223,7 +223,7 @@ allocateDuplicateStr ( { RedfishCS_status Status; =20 - if ((Str =3D=3D NULL) || (strlen (Str) =3D=3D 0)) { + if (Str =3D=3D NULL) { *DstBuffer =3D NULL; return RedfishCS_status_success; } --=20 2.17.1