From patchwork Fri Apr 5 12:59:42 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Tremer X-Patchwork-Id: 7714 Return-Path: Received: from mail01.ipfire.org (mail01.haj.ipfire.org [172.28.1.202]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) client-signature ECDSA (secp384r1)) (Client CN "mail01.haj.ipfire.org", Issuer "R3" (verified OK)) by web04.haj.ipfire.org (Postfix) with ESMTPS id 4V9z9d4zKPz3wvx for ; Fri, 5 Apr 2024 13:00:21 +0000 (UTC) Received: from mail02.haj.ipfire.org (mail02.haj.ipfire.org [172.28.1.201]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) client-signature ECDSA (secp384r1)) (Client CN "mail02.haj.ipfire.org", Issuer "R3" (verified OK)) by mail01.ipfire.org (Postfix) with ESMTPS id 4V9z9J1kjrz67W; Fri, 5 Apr 2024 13:00:04 +0000 (UTC) Received: from mail02.haj.ipfire.org (localhost [127.0.0.1]) by mail02.haj.ipfire.org (Postfix) with ESMTP id 4V9z9J0XSHz30VV; Fri, 5 Apr 2024 13:00:04 +0000 (UTC) Received: from mail01.ipfire.org (mail01.haj.ipfire.org [172.28.1.202]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) client-signature ECDSA (secp384r1)) (Client CN "mail01.haj.ipfire.org", Issuer "R3" (verified OK)) by mail02.haj.ipfire.org (Postfix) with ESMTPS id 4V9z915t9Pz32jQ for ; Fri, 5 Apr 2024 12:59:49 +0000 (UTC) Received: from michael.haj.ipfire.org (michael.haj.ipfire.org [172.28.1.242]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) client-signature ECDSA (secp384r1)) (Client CN "michael.haj.ipfire.org", Issuer "R3" (verified OK)) by mail01.ipfire.org (Postfix) with ESMTPS id 4V9z9134Q3z5VK; Fri, 5 Apr 2024 12:59:49 +0000 (UTC) Received: by michael.haj.ipfire.org (Postfix, from userid 0) id 4V9z8x54FWzTwT8; Fri, 5 Apr 2024 12:59:45 +0000 (UTC) From: Michael Tremer To: development@lists.ipfire.org Subject: [PATCH 13/13] installer: Fix using uninitialized variables Date: Fri, 5 Apr 2024 12:59:42 +0000 Message-Id: <20240405125942.1803058-13-michael.tremer@ipfire.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240405125942.1803058-1-michael.tremer@ipfire.org> References: <20240405125942.1803058-1-michael.tremer@ipfire.org> MIME-Version: 1.0 Message-ID-Hash: JDZ5BYUB254BUIZF3CREMXY2OM7WRMJX X-Message-ID-Hash: JDZ5BYUB254BUIZF3CREMXY2OM7WRMJX X-MailFrom: root@michael.haj.ipfire.org X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header CC: Michael Tremer X-Mailman-Version: 3.3.8 Precedence: list List-Id: IPFire development talk Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: Signed-off-by: Michael Tremer --- src/installer/main.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/installer/main.c b/src/installer/main.c index 944ffa593..70a240ccb 100644 --- a/src/installer/main.c +++ b/src/installer/main.c @@ -368,6 +368,8 @@ int main(int argc, char *argv[]) { char discl_msg[40000] = "Disclaimer\n"; char* sourcedrive = NULL; + struct hw_destination* destination = NULL; + struct hw_disk** selected_disks = NULL; int rc = 0; char commandstring[STRING_SIZE]; int choice; @@ -589,8 +591,6 @@ int main(int argc, char *argv[]) { // Scan for disks to install on. struct hw_disk** disks = hw_find_disks(hw, sourcedrive); - - struct hw_disk** selected_disks = NULL; unsigned int num_selected_disks = 0; // Check how many disks have been found and what @@ -720,8 +720,7 @@ int main(int argc, char *argv[]) { filesystem = filesystems[fs_choice].fstype; } - struct hw_destination* destination = hw_make_destination(hw, part_type, - selected_disks, config.disable_swap, filesystem); + destination = hw_make_destination(hw, part_type, selected_disks, config.disable_swap, filesystem); if (!destination) { errorbox(_("Your harddisk is too small."));