forked from enlightenment/enlightenment
connman: avoid random memory walk in case dbus data aren't provided by connman.
This commit is contained in:
parent
571f688e32
commit
689441781a
|
@ -694,31 +694,33 @@ _connman_technology_parse_prop_changed(Connman_Technology *ct, const char *name,
|
||||||
|
|
||||||
if (!strcmp(name, "Powered"))
|
if (!strcmp(name, "Powered"))
|
||||||
{
|
{
|
||||||
eldbus_message_iter_arguments_get(value, "b", &val);
|
if (!eldbus_message_iter_arguments_get(value, "b", &val)) goto exit;
|
||||||
|
|
||||||
val = !!val;
|
val = !!val;
|
||||||
if (val != ct->powered) ret = EINA_TRUE;
|
if (val != ct->powered) ret = EINA_TRUE;
|
||||||
ct->powered = !!val;
|
ct->powered = !!val;
|
||||||
}
|
}
|
||||||
else if (!strcmp(name, "Connected"))
|
else if (!strcmp(name, "Connected"))
|
||||||
{
|
{
|
||||||
eldbus_message_iter_arguments_get(value, "b", &val);
|
if (!eldbus_message_iter_arguments_get(value, "b", &val)) goto exit;
|
||||||
ct->connected = !!val;
|
ct->connected = !!val;
|
||||||
}
|
}
|
||||||
else if (!strcmp(name, "Tethering"))
|
else if (!strcmp(name, "Tethering"))
|
||||||
{
|
{
|
||||||
eldbus_message_iter_arguments_get(value, "b", &val);
|
if (!eldbus_message_iter_arguments_get(value, "b", &val)) goto exit;
|
||||||
ct->tethering = !!val;
|
ct->tethering = !!val;
|
||||||
}
|
}
|
||||||
else if (!strcmp(name, "TetheringIdentifier"))
|
else if (!strcmp(name, "TetheringIdentifier"))
|
||||||
{
|
{
|
||||||
eldbus_message_iter_arguments_get(value, "b", &str);
|
if (!eldbus_message_iter_arguments_get(value, "b", &str)) goto exit;
|
||||||
ct->tethering_ssid = eina_stringshare_add(str);
|
ct->tethering_ssid = eina_stringshare_add(str);
|
||||||
}
|
}
|
||||||
else if (!strcmp(name, "TetheringPassphrase"))
|
else if (!strcmp(name, "TetheringPassphrase"))
|
||||||
{
|
{
|
||||||
eldbus_message_iter_arguments_get(value, "b", &str);
|
if (!eldbus_message_iter_arguments_get(value, "b", &str)) goto exit;
|
||||||
ct->tethering_passwd = eina_stringshare_add(str);
|
ct->tethering_passwd = eina_stringshare_add(str);
|
||||||
}
|
}
|
||||||
|
exit:
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue