config: fix a crash in nm_config_device_get_hwaddr()

get_hw_address (nm_device_get_hw_address()) asserts and then SIGSEGV
happens in nm_utils_hwaddr_ntoa().

Found by pavlix in NM live VM.
This commit is contained in:
Jiří Klimeš 2013-04-23 18:43:23 +02:00
parent 841c259119
commit ac6543305e

View file

@ -73,7 +73,7 @@ char *
nm_config_device_get_hwaddr (NMConfigDevice *self)
{
const guint8 *bytes;
guint len;
guint len = 0;
bytes = NM_CONFIG_DEVICE_GET_INTERFACE (self)->get_hw_address (self, &len);
return nm_utils_hwaddr_ntoa (bytes, nm_utils_hwaddr_type (len));