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: 69f048bf0c ('cloud-setup: add tool for automatic IP configuration in cloud')
This commit is contained in:
Thomas Haller 2020-06-29 09:52:18 +02:00
parent 8209095ee1
commit 460afe6d50
No known key found for this signature in database
GPG key ID: 29C2366E4DFC5728

View file

@ -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';