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: 69f048bf ('cloud-setup: add tool for automatic IP configuration in cloud')
(cherry picked from commit 460afe6d)
(cherry picked from commit 181fd5c6)
(cherry picked from commit 9fed652d)
parent f59af102
......@@ -484,7 +484,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';
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment