Blob Blame History Raw
From e8e245f0ce414bbe9b8ef6c13404b73b12dd34ad Mon Sep 17 00:00:00 2001
From: Thomas Haller <thaller@redhat.com>
Date: Mon, 29 Jun 2020 09:52:18 +0200
Subject: [PATCH 1/1] cloud-setup: fix allocating buffer for
 GetConfigMetadataMac in _get_config_metadata_ready_check()

It's not a severe issue, because the GetConfigMetadataData struct is
larger than GetConfigMetadataMac.

Fixes: 69f048bf0ca3 ('cloud-setup: add tool for automatic IP configuration in cloud')
(cherry picked from commit 460afe6d502f2a8f158739c176302fd7fa072913)
(cherry picked from commit 181fd5c611e070c0563ec2659c8642ffe567e738)
---
 clients/cloud-setup/nmcs-provider-ec2.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/clients/cloud-setup/nmcs-provider-ec2.c b/clients/cloud-setup/nmcs-provider-ec2.c
index c8db31f97f67..3b5f6d36a82e 100644
--- a/clients/cloud-setup/nmcs-provider-ec2.c
+++ b/clients/cloud-setup/nmcs-provider-ec2.c
@@ -487,7 +487,7 @@ _get_config_metadata_ready_check (long response_code,
 		if (!response_parsed)
 			response_parsed = g_hash_table_new_full (nm_str_hash, g_str_equal, g_free, g_free);
 
-		mac_data = g_malloc (sizeof (GetConfigMetadataData) + 1 + p_start_l);
+		mac_data = g_malloc (sizeof (GetConfigMetadataMac) + 1 + p_start_l);
 		mac_data->iface_idx = iface_idx_counter++;
 		memcpy (mac_data->path, p_start, p_start_l);
 		mac_data->path[p_start_l] = '\0';
-- 
2.26.2