From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: mx.groups.io; dkim=pass header.i=@armh.onmicrosoft.com header.s=selector2-armh-onmicrosoft-com header.b=c1gdU488; spf=pass (domain: arm.com, ip: 40.107.1.45, mailfrom: sami.mujawar@arm.com) Received: from EUR02-HE1-obe.outbound.protection.outlook.com (EUR02-HE1-obe.outbound.protection.outlook.com [40.107.1.45]) by groups.io with SMTP; Fri, 23 Aug 2019 03:58:41 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com; s=selector2-armh-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=QlxMIRiJqo0if4y5BqLqFQ2BCsfUlDNJyljFlvzDOU8=; b=c1gdU488w6jyDpRzP1mCTnMat0RYTxiZgZ6pJhu0rOua5HGwjPh3ESbSiNS/4vcAkg0/vd2zPqO/ENxDlZn2BYD0fSSY6lKCVe8HMnIalxHNB2jUI23AfokJVGSZHJ6JR1SUMzois6tWoUCfoWRl7zIfqt1j/0D5VkcsKhdd6pc= Received: from VI1PR08CA0140.eurprd08.prod.outlook.com (2603:10a6:800:d5::18) by HE1PR0802MB2603.eurprd08.prod.outlook.com (2603:10a6:3:e0::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2178.16; Fri, 23 Aug 2019 10:58:36 +0000 Received: from DB5EUR03FT023.eop-EUR03.prod.protection.outlook.com (2a01:111:f400:7e0a::204) by VI1PR08CA0140.outlook.office365.com (2603:10a6:800:d5::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.2199.14 via Frontend Transport; Fri, 23 Aug 2019 10:58:36 +0000 Authentication-Results: spf=temperror (sender IP is 63.35.35.123) smtp.mailfrom=arm.com; edk2.groups.io; dkim=pass (signature was verified) header.d=armh.onmicrosoft.com;edk2.groups.io; dmarc=temperror action=none header.from=arm.com; Received-SPF: TempError (protection.outlook.com: error in processing during lookup of arm.com: DNS Timeout) Received: from 64aa7808-outbound-1.mta.getcheckrecipient.com (63.35.35.123) by DB5EUR03FT023.mail.protection.outlook.com (10.152.20.68) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.2199.13 via Frontend Transport; Fri, 23 Aug 2019 10:58:35 +0000 Received: ("Tessian outbound eba0b9aef687:v27"); Fri, 23 Aug 2019 10:58:35 +0000 X-CheckRecipientChecked: true X-CR-MTA-CID: 459e4c5cb034a56c X-CR-MTA-TID: 64aa7808 Received: from 901e375a38cf.1 (ip-172-16-0-2.eu-west-1.compute.internal [104.47.0.55]) by 64aa7808-outbound-1.mta.getcheckrecipient.com id 8A1366CB-8B52-45C8-A573-48294B84563B.1; Fri, 23 Aug 2019 10:58:29 +0000 Received: from EUR01-HE1-obe.outbound.protection.outlook.com (mail-he1eur01lp2055.outbound.protection.outlook.com [104.47.0.55]) by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id 901e375a38cf.1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Fri, 23 Aug 2019 10:58:29 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=hs45hWIgXELQphESKjxEp2Kg8YMWnOhQR57a8m8WWgnbJqr2lISdK9QDFDfznZX60tq3USjJQRvuyCacqODJnkLYR/do74hH4dlLHtFosxjA9EIjkOp4MD7j7s/7XumGf6pgtZ6xneVLsMnig/kEwFnp+t0Ajb7NcRBAfimId9zMbRRG+p40WORRlKlI2TiWbOm/N5GX6gs99gcs5F8OOkm+xYhFJRdOlswwNjEg0xCsg7WvN+0nEzBKhnf4iTlb+0h9UjATljXdQ7g/ys7lA04galgVYLph8X0Sncw7BkwGDqJSsHh2/l57TaSyKPY+JfheXucfAjfMkhdwG7hdVQ== 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-SenderADCheck; bh=QlxMIRiJqo0if4y5BqLqFQ2BCsfUlDNJyljFlvzDOU8=; b=Ux7waEUMC8b8XsiqH1Ycko9tux2ICmZyTAXliYXCIE1jrm3LXYUvCBWWHDgsmdNEHjf6Lj40VkjzjWipwbzn7qmbicKNKWJjJhTfa1rBUvbhj4AGTee0MgEGHzOQevgZm9WqEAP3W40VoP/ZDaZ6qXL2VfREfBGXCKBDKH+2+GEpD5E3mmHsRGq16Iu5wm7yj0KlsNv7wGqxCXr5dtvMbEfFJMgtsRgc695WA+5RXzNterT643QhVWLN+oMBLE//Kqqm/qDHmb3AUbvMPWXfVoLWcXtAt6RfOgyYdeMvGmr2ZuOYHurC8D9n/GYw3ILyDz8uLBS+OYbT/uSJb5LabQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=temperror (sender ip is 40.67.248.234) smtp.rcpttodomain=edk2.groups.io smtp.mailfrom=arm.com; dmarc=temperror action=none header.from=arm.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com; s=selector2-armh-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=QlxMIRiJqo0if4y5BqLqFQ2BCsfUlDNJyljFlvzDOU8=; b=c1gdU488w6jyDpRzP1mCTnMat0RYTxiZgZ6pJhu0rOua5HGwjPh3ESbSiNS/4vcAkg0/vd2zPqO/ENxDlZn2BYD0fSSY6lKCVe8HMnIalxHNB2jUI23AfokJVGSZHJ6JR1SUMzois6tWoUCfoWRl7zIfqt1j/0D5VkcsKhdd6pc= Received: from VE1PR08CA0034.eurprd08.prod.outlook.com (2603:10a6:803:104::47) by HE1PR0801MB1852.eurprd08.prod.outlook.com (2603:10a6:3:7c::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2178.16; Fri, 23 Aug 2019 10:58:27 +0000 Received: from AM5EUR03FT064.eop-EUR03.prod.protection.outlook.com (2a01:111:f400:7e08::205) by VE1PR08CA0034.outlook.office365.com (2603:10a6:803:104::47) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2199.15 via Frontend Transport; Fri, 23 Aug 2019 10:58:26 +0000 Authentication-Results-Original: spf=temperror (sender IP is 40.67.248.234) smtp.mailfrom=arm.com; edk2.groups.io; dkim=none (message not signed) header.d=none;edk2.groups.io; dmarc=temperror action=none header.from=arm.com; Received-SPF: TempError (protection.outlook.com: error in processing during lookup of arm.com: DNS Timeout) Received: from nebula.arm.com (40.67.248.234) by AM5EUR03FT064.mail.protection.outlook.com (10.152.17.53) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.2199.13 via Frontend Transport; Fri, 23 Aug 2019 10:58:25 +0000 Received: from AZ-NEU-EX03.Arm.com (10.251.24.31) by AZ-NEU-EX03.Arm.com (10.251.24.31) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1415.2; Fri, 23 Aug 2019 10:56:27 +0000 Received: from E107187.Arm.com (10.1.195.55) by mail.arm.com (10.251.24.31) with Microsoft SMTP Server id 15.1.1415.2 via Frontend Transport; Fri, 23 Aug 2019 10:56:27 +0000 From: "Sami Mujawar" To: CC: Sami Mujawar , , , , , , , Subject: [PATCH v1 19/19] MdePkg: Initialise VA_LIST variables before use Date: Fri, 23 Aug 2019 11:55:39 +0100 Message-ID: <20190823105539.13260-20-sami.mujawar@arm.com> X-Mailer: git-send-email 2.11.0.windows.3 In-Reply-To: <20190823105539.13260-1-sami.mujawar@arm.com> References: <20190823105539.13260-1-sami.mujawar@arm.com> MIME-Version: 1.0 X-EOPAttributedMessage: 1 X-MS-Office365-Filtering-HT: Tenant X-Forefront-Antispam-Report-Untrusted: CIP:40.67.248.234;IPV:NLI;CTRY:IE;EFV:NLI;SFV:NSPM;SFS:(10009020)(4636009)(376002)(136003)(396003)(39860400002)(346002)(2980300002)(189003)(199004)(4326008)(50226002)(8676002)(53416004)(486006)(305945005)(81156014)(50466002)(2616005)(11346002)(426003)(2351001)(2906002)(476003)(446003)(36756003)(53936002)(8936002)(86362001)(316002)(54906003)(126002)(16586007)(1076003)(7696005)(63370400001)(26005)(51416003)(44832011)(6916009)(5660300002)(81166006)(76176011)(6666004)(47776003)(356004)(70206006)(70586007)(63350400001)(478600001)(186003)(336012)(48376002)(14444005);DIR:OUT;SFP:1101;SCL:1;SRVR:HE1PR0801MB1852;H:nebula.arm.com;FPR:;SPF:TempError;LANG:en;PTR:InfoDomainNonexistent;MX:1;A:1; X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 37778b23-d913-4270-99da-08d727b8d83d X-Microsoft-Antispam-Untrusted: BCL:0;PCL:0;RULEID:(2390118)(7020095)(4652040)(8989299)(5600166)(711020)(4605104)(1401327)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(2017052603328);SRVR:HE1PR0801MB1852; X-MS-TrafficTypeDiagnostic: HE1PR0801MB1852:|HE1PR0802MB2603: X-Microsoft-Antispam-PRVS: x-checkrecipientrouted: true X-MS-Oob-TLC-OOBClassifiers: OLM:230;OLM:230; X-Forefront-PRVS: 0138CD935C X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam-Message-Info-Original: 1nKToDFZOfwfzygC9H0WKuJfZg37riEdLjh4Bt148P3LGlG+shEkBaShP9Ucv3KmikLhrGS6phmXnuNAruXUg6yNkpfMHRHzxsJB1HtWBhemt4qw7wQWoycJWOiYX7BzrkCzszgwZjEtKOa78rpxfh5NPUI3SM7miZVt3InWYXlyomSBR7vYFEuiFMf96YZeDaLHfYPFRW51huu3pmRj3rPLSuED+GLvl4V40iJPF7fH3XqGaftndE2hY+t+PLocJwWGPXd/ojB06q2Q45P/W3o5/xKoYH4cuN3l5qicNUj9+5mbMaIVZC+W0LCjGkFyDrCxoutcue3/IP918sr43t/3Z5XlQ8TvTJ/QtT2kPUPRXuwdIxRpXBNeCKBHsBsC8y4YwqQhtKRje6mK1QkOG7+G9sOZK6A1AD3zzUTGTFE= X-MS-Exchange-Transport-CrossTenantHeadersStamped: HE1PR0801MB1852 Original-Authentication-Results: spf=temperror (sender IP is 40.67.248.234) smtp.mailfrom=arm.com; edk2.groups.io; dkim=none (message not signed) header.d=none;edk2.groups.io; dmarc=temperror action=none header.from=arm.com; Return-Path: Sami.Mujawar@arm.com X-MS-Exchange-Transport-CrossTenantHeadersStripped: DB5EUR03FT023.eop-EUR03.prod.protection.outlook.com X-Forefront-Antispam-Report: CIP:63.35.35.123;IPV:CAL;SCL:-1;CTRY:IE;EFV:NLI;SFV:NSPM;SFS:(10009020)(4636009)(376002)(396003)(39860400002)(346002)(136003)(2980300002)(189003)(199004)(2616005)(76176011)(14444005)(86362001)(22756006)(6916009)(70206006)(70586007)(1076003)(16586007)(81156014)(54906003)(7696005)(51416003)(81166006)(47776003)(316002)(8936002)(8676002)(305945005)(186003)(26005)(36756003)(336012)(50466002)(2906002)(50226002)(4326008)(6666004)(5660300002)(76130400001)(2351001)(53416004)(63370400001)(478600001)(63350400001)(11346002)(446003)(426003)(44832011)(26826003)(126002)(48376002)(486006)(476003);DIR:OUT;SFP:1101;SCL:1;SRVR:HE1PR0802MB2603;H:64aa7808-outbound-1.mta.getcheckrecipient.com;FPR:;SPF:TempError;LANG:en;PTR:ec2-63-35-35-123.eu-west-1.compute.amazonaws.com;MX:1;A:1; X-MS-Office365-Filtering-Correlation-Id-Prvs: 52d7384c-6474-4dc8-ff5c-08d727b8d2b6 X-Microsoft-Antispam: BCL:0;PCL:0;RULEID:(2390118)(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600166)(710020)(711020)(4605104)(1401327)(2017052603328);SRVR:HE1PR0802MB2603; NoDisclaimer: True X-Forefront-PRVS: 0138CD935C X-Microsoft-Antispam-Message-Info: HBIpJwz0XPT6TtDa7+1tgr/wMwURKY8egmdIyiKC5xUzagMUqFmXvVy3b8kG/zX56OMfgnEfYM4qV98kcKdKQxKeOCYE/wIZeOPgOqOMjGscOnO5MP5dJAhNRxfZ6U8Bj20xAME1vsHLkLfSSdEGPeXk8zmGHLoaAWVcIcnm5XqtyIGWhyYlEiJvewxZhm9WG0ilToQ1wEUwD/d8k+T8Ed2PBIsjzwp+MkKUT7JWzNmv257+ZfqhseYpxH+6jGfjmIXh9Sp4ZSLqJI0q4HuvM6JWuF6t6oGSRUWlFVp+h6upImouu6SAC99NEn6h/E+fcbt+ht7Rhc8Ww4Dil7JMadcqmzRlH1Bf3RajdEV8hv4AfPFzuHT7X467iTOHEGazDy1TV4T4UbQxtbfPeNFoFkdHwxMgyOVnzgtHJVlW0Nw= X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 23 Aug 2019 10:58:35.1065 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 37778b23-d913-4270-99da-08d727b8d83d X-MS-Exchange-CrossTenant-Id: f34e5979-57d9-4aaa-ad4d-b122a662184d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=f34e5979-57d9-4aaa-ad4d-b122a662184d;Ip=[63.35.35.123];Helo=[64aa7808-outbound-1.mta.getcheckrecipient.com] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: HE1PR0802MB2603 Content-Type: text/plain The VS2017 compiler reports 'warning C6001: Using uninitialized memory 'Marker'.' for VA_LIST variables. To fix this issue declare a VA_LIST global variable and use this to initialise VA_LIST variables before use. Note: The VA_LIST cannot be assigned a NULL value because some compilers define VA_LIST to be a structure. Signed-off-by: Sami Mujawar --- MdePkg/Library/BaseLib/SwitchStack.c | 9 +++++++++ MdePkg/Library/BasePrintLib/PrintLib.c | 5 +++++ MdePkg/Library/BasePrintLib/PrintLibInternal.c | 9 +++++++++ 3 files changed, 23 insertions(+) diff --git a/MdePkg/Library/BaseLib/SwitchStack.c b/MdePkg/Library/BaseLib/SwitchStack.c index cb9f69f1eaceba690b48e9ca6b8a9af2e348bddd..e1bb524819b3de3521c5461ce681aa3a6c186f2c 100644 --- a/MdePkg/Library/BaseLib/SwitchStack.c +++ b/MdePkg/Library/BaseLib/SwitchStack.c @@ -2,12 +2,20 @@ Switch Stack functions. Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.
+ Copyright (c) 2019, ARM Ltd. All rights reserved.
SPDX-License-Identifier: BSD-2-Clause-Patent **/ #include "BaseLibInternals.h" +// +// Declare a VA_LIST global variable that is used to initialise VA_LIST +// variables before use. The VA_LIST cannot be assigned a NULL value +// because some compilers define VA_LIST to be a structure. +// +STATIC VA_LIST gNullVaList; + /** Transfers control to a function starting with a new stack. @@ -57,6 +65,7 @@ SwitchStack ( // ASSERT (((UINTN)NewStack & (CPU_STACK_ALIGNMENT - 1)) == 0); + Marker = gNullVaList; VA_START (Marker, NewStack); InternalSwitchStack (EntryPoint, Context1, Context2, NewStack, Marker); diff --git a/MdePkg/Library/BasePrintLib/PrintLib.c b/MdePkg/Library/BasePrintLib/PrintLib.c index af771652e4b0aebd616973ba1089ae5bc2b6f0c0..67c5f3dd547cea5447075ef88d697879883ba5ab 100644 --- a/MdePkg/Library/BasePrintLib/PrintLib.c +++ b/MdePkg/Library/BasePrintLib/PrintLib.c @@ -3,6 +3,7 @@ Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.
Portions copyright (c) 2008 - 2009, Apple Inc. All rights reserved.
+ Copyright (c) 2019, ARM Ltd. All rights reserved.
SPDX-License-Identifier: BSD-2-Clause-Patent **/ @@ -177,6 +178,7 @@ UnicodeSPrint ( VA_LIST Marker; UINTN NumberOfPrinted; + Marker = gNullVaList; VA_START (Marker, FormatString); NumberOfPrinted = UnicodeVSPrint (StartOfBuffer, BufferSize, FormatString, Marker); VA_END (Marker); @@ -337,6 +339,7 @@ UnicodeSPrintAsciiFormat ( VA_LIST Marker; UINTN NumberOfPrinted; + Marker = gNullVaList; VA_START (Marker, FormatString); NumberOfPrinted = UnicodeVSPrintAsciiFormat (StartOfBuffer, BufferSize, FormatString, Marker); VA_END (Marker); @@ -614,6 +617,7 @@ AsciiSPrint ( VA_LIST Marker; UINTN NumberOfPrinted; + Marker = gNullVaList; VA_START (Marker, FormatString); NumberOfPrinted = AsciiVSPrint (StartOfBuffer, BufferSize, FormatString, Marker); VA_END (Marker); @@ -774,6 +778,7 @@ AsciiSPrintUnicodeFormat ( VA_LIST Marker; UINTN NumberOfPrinted; + Marker = gNullVaList; VA_START (Marker, FormatString); NumberOfPrinted = AsciiVSPrintUnicodeFormat (StartOfBuffer, BufferSize, FormatString, Marker); VA_END (Marker); diff --git a/MdePkg/Library/BasePrintLib/PrintLibInternal.c b/MdePkg/Library/BasePrintLib/PrintLibInternal.c index b6ec5ac4fbb98982f8ccaf3908c2a91ce583e31e..11392f2a5d12eb059611c3ff77b27b602f9b9a40 100644 --- a/MdePkg/Library/BasePrintLib/PrintLibInternal.c +++ b/MdePkg/Library/BasePrintLib/PrintLibInternal.c @@ -2,12 +2,20 @@ Print Library internal worker functions. Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.
+ Copyright (c) 2019, ARM Ltd. All rights reserved.
SPDX-License-Identifier: BSD-2-Clause-Patent **/ #include "PrintLibInternal.h" +// +// Declare a VA_LIST global variable that is used to initialise VA_LIST +// variables before use. The VA_LIST cannot be assigned a NULL value +// because some compilers define VA_LIST to be a structure. +// +extern VA_LIST gNullVaList; + #define WARNING_STATUS_NUMBER 5 #define ERROR_STATUS_NUMBER 33 @@ -1256,6 +1264,7 @@ BasePrintLibSPrint ( VA_LIST Marker; UINTN NumberOfPrinted; + Marker = gNullVaList; VA_START (Marker, FormatString); NumberOfPrinted = BasePrintLibSPrintMarker (StartOfBuffer, BufferSize, Flags, FormatString, Marker, NULL); VA_END (Marker); -- 'Guid(CE165669-3EF3-493F-B85D-6190EE5B9759)'