From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from firstgate.proxmox.com (firstgate.proxmox.com [212.224.123.68]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by lists.proxmox.com (Postfix) with ESMTPS id E4B2485937 for ; Mon, 20 Dec 2021 15:12:50 +0100 (CET) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id D8C031DDEE for ; Mon, 20 Dec 2021 15:12:50 +0100 (CET) Received: from proxmox-new.maurer-it.com (proxmox-new.maurer-it.com [94.136.29.106]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by firstgate.proxmox.com (Proxmox) with ESMTPS id 6D9761DDE4 for ; Mon, 20 Dec 2021 15:12:50 +0100 (CET) Received: from proxmox-new.maurer-it.com (localhost.localdomain [127.0.0.1]) by proxmox-new.maurer-it.com (Proxmox) with ESMTP id 3869F44F36 for ; Mon, 20 Dec 2021 15:04:01 +0100 (CET) From: Mira Limbeck To: pve-devel@lists.proxmox.com Date: Mon, 20 Dec 2021 15:03:59 +0100 Message-Id: <20211220140359.288489-1-m.limbeck@proxmox.com> X-Mailer: git-send-email 2.30.2 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-SPAM-LEVEL: Spam detection results: 0 AWL -0.212 Adjusted score from AWL reputation of From: address BAYES_00 -1.9 Bayes spam probability is 0 to 1% KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment KAM_LAZY_DOMAIN_SECURITY 1 Sending domain does not have any anti-forgery methods NO_DNS_FOR_FROM 0.001 Envelope sender has no MX or A DNS records SPF_HELO_NONE 0.001 SPF: HELO does not publish an SPF Record SPF_NONE 0.001 SPF: sender does not publish an SPF Record Subject: [pve-devel] [PATCH qemu-server] fix #3792: cloudinit: use of uninitialized value X-BeenThere: pve-devel@lists.proxmox.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Proxmox VE development discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 20 Dec 2021 14:12:50 -0000 With the patch adding vendor-data support to cloud-init, a use of uninitialized value was introduced. This can be fixed by setting it to an empty string if no vendor-data is defined. vendor-data can only be set via --cicustom and is optional. Signed-off-by: Mira Limbeck --- PVE/QemuServer/Cloudinit.pm | 2 ++ 1 file changed, 2 insertions(+) diff --git a/PVE/QemuServer/Cloudinit.pm b/PVE/QemuServer/Cloudinit.pm index cc8970c..b7daa2a 100644 --- a/PVE/QemuServer/Cloudinit.pm +++ b/PVE/QemuServer/Cloudinit.pm @@ -230,6 +230,7 @@ sub generate_configdrive2 { my ($user_data, $network_data, $meta_data, $vendor_data) = get_custom_cloudinit_files($conf); $user_data = cloudinit_userdata($conf, $vmid) if !defined($user_data); $network_data = configdrive2_network($conf) if !defined($network_data); + $vendor_data = '' if !defined($vendor_data); if (!defined($meta_data)) { $meta_data = configdrive2_gen_metadata($user_data, $network_data); @@ -486,6 +487,7 @@ sub generate_nocloud { my ($user_data, $network_data, $meta_data, $vendor_data) = get_custom_cloudinit_files($conf); $user_data = cloudinit_userdata($conf, $vmid) if !defined($user_data); $network_data = nocloud_network($conf) if !defined($network_data); + $vendor_data = '' if !defined($vendor_data); if (!defined($meta_data)) { $meta_data = nocloud_gen_metadata($user_data, $network_data); -- 2.30.2