summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJett Rink <jettrink@google.com>2023-02-24 17:26:41 +0000
committerChromeos LUCI <chromeos-scoped@luci-project-accounts.iam.gserviceaccount.com>2023-04-27 21:39:21 +0000
commitf00768dfa8c4ffbd234877547d756a553023e0f2 (patch)
treea3c47da104c94c6ec4f69733aa4c4b753eaa5a5c
parent0035ec6dd952ee3ba4873596bbdc2c8ab7ab8207 (diff)
downloadchrome-ec-f00768dfa8c4ffbd234877547d756a553023e0f2.tar.gz
gsctool: initialize char* pointer correctly
If gsctool is compiled more strictly, these uninitialized variables cause errors. Set the pointers to empty string like other char* variables. BUG=none TEST=make all for gsctool compiles without errors in a more strict setting Change-Id: Id65d51bcc5b81451f4235650c2cf8042986d5197 Signed-off-by: Jett Rink <jettrink@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4290237 Reviewed-by: Mary Ruthven <mruthven@chromium.org> Auto-Submit: Jett Rink <jettrink@chromium.org> Tested-by: Jett Rink <jettrink@chromium.org> Commit-Queue: Mary Ruthven <mruthven@chromium.org> Commit-Queue: Jett Rink <jettrink@chromium.org> (cherry picked from commit ed9c50d5e63079aa12499e1f9495b4457995bdce) Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4481585 Tested-by: Mary Ruthven <mruthven@chromium.org> Reviewed-by: Jett Rink <jettrink@chromium.org> Auto-Submit: Mary Ruthven <mruthven@chromium.org>
-rw-r--r--extra/usb_updater/gsctool.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/extra/usb_updater/gsctool.c b/extra/usb_updater/gsctool.c
index 8af5f0c550..c4402de461 100644
--- a/extra/usb_updater/gsctool.c
+++ b/extra/usb_updater/gsctool.c
@@ -3892,7 +3892,7 @@ int main(int argc, char *argv[])
int rma = 0;
const char *rma_auth_code = "";
int get_endorsement_seed = 0;
- const char *endorsement_seed_str;
+ const char *endorsement_seed_str = "";
int corrupt_inactive_rw = 0;
struct board_id bid;
enum board_id_action bid_action;
@@ -3923,7 +3923,7 @@ int main(int argc, char *argv[])
"Options -a, -s and -t are mutually exclusive\n";
const char *openbox_desc_file = NULL;
int factory_mode = 0;
- char *factory_mode_arg;
+ char *factory_mode_arg = "";
char *tpm_mode_arg = NULL;
char *serial = NULL;
int sn_bits = 0;