quick-settings: validate D-Bus variant types and sanitize SSID

parent 7f91a63b
......@@ -250,9 +250,12 @@ namespace XimperShellNotificationCenter.Widgets {
DBusConnection conn, string ?sender,
string path, string iface, string signal,
Variant params) {
string iface_name;
params.get_child (0, "s", out iface_name);
if (iface_name == "org.bluez.Device1") {
if (params.n_children () == 0) return;
Variant child = params.get_child_value (0);
if (!child.is_of_type (VariantType.STRING)) {
return;
}
if (child.get_string () == "org.bluez.Device1") {
load_devices.begin ();
}
}
......
......@@ -171,7 +171,7 @@ namespace XimperShellNotificationCenter.Widgets {
}
public static string ssid_to_string (uint8[] ssid) {
return (string) ssid;
return ((string) ssid).make_valid ();
}
public static string get_signal_icon (uint8 strength) {
......
......@@ -44,7 +44,8 @@ namespace XimperShellNotificationCenter.Widgets {
profile_names = {};
foreach (var profile in proxy.profiles) {
Variant ?v = profile.lookup ("Profile");
if (v != null) {
if (v != null
&& v.is_of_type (VariantType.STRING)) {
profile_names += v.get_string ();
}
}
......
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