From: "Nickle Wang" <nicklew@nvidia.com>
To: <devel@edk2.groups.io>
Cc: Abner Chang <abner.chang@amd.com>, Nick Ramirez <nramirez@nvidia.com>
Subject: [PATCH] RedfishPkg/JsonLib: Fix JsonLib build failure
Date: Wed, 21 Sep 2022 20:42:33 +0800 [thread overview]
Message-ID: <20220921124233.1474-1-nicklew@nvidia.com> (raw)
VS2019 reports build failure: "warning C4701: potentially uninitialized
local variable 'Ucs2Str' used". Initial Ucs2Str to NULL at the beginning
of function.
Cc: Abner Chang <abner.chang@amd.com>
Cc: Nick Ramirez <nramirez@nvidia.com>
Signed-off-by: Nickle Wang <nicklew@nvidia.com>
---
RedfishPkg/Library/JsonLib/JsonLib.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/RedfishPkg/Library/JsonLib/JsonLib.c b/RedfishPkg/Library/JsonLib/JsonLib.c
index 33d5eaef79..88b89bf6f8 100644
--- a/RedfishPkg/Library/JsonLib/JsonLib.c
+++ b/RedfishPkg/Library/JsonLib/JsonLib.c
@@ -6,6 +6,7 @@
Copyright (c) 2018 - 2019, Intel Corporation. All rights reserved.<BR>
(C) Copyright 2021 Hewlett Packard Enterprise Development LP<BR>
+ Copyright (c) 2022 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
SPDX-License-Identifier: BSD-2-Clause-Patent
**/
@@ -566,6 +567,7 @@ JsonValueGetUnicodeString (
CONST CHAR8 *Utf8Str;
CHAR16 *Ucs2Str;
+ Ucs2Str = NULL;
Utf8Str = json_string_value ((json_t *) Json);
if (Utf8Str == NULL) {
return NULL;
--
2.37.3.windows.1
next reply other threads:[~2022-09-21 12:43 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-09-21 12:42 Nickle Wang [this message]
2022-09-22 4:44 ` [edk2-devel] [PATCH] RedfishPkg/JsonLib: Fix JsonLib build failure Chang, Abner
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-list from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20220921124233.1474-1-nicklew@nvidia.com \
--to=devel@edk2.groups.io \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox