From ed9c50d5e63079aa12499e1f9495b4457995bdce Mon Sep 17 00:00:00 2001 From: Jett Rink Date: Fri, 24 Feb 2023 17:26:41 +0000 Subject: 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 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4290237 Reviewed-by: Mary Ruthven Auto-Submit: Jett Rink Tested-by: Jett Rink Commit-Queue: Mary Ruthven Commit-Queue: Jett Rink --- extra/usb_updater/gsctool.c | 4 ++-- 1 file 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; -- cgit v1.2.1