Commit f7c51b0d authored by Volkau Siarhei's avatar Volkau Siarhei Committed by Bastien Nocera

tests: Fix segfault in verify when used without -f

We tried to use strcmp on a NULL string.

https://bugs.freedesktop.org/show_bug.cgi?id=85736
parent f94c8727
......@@ -27,7 +27,7 @@
static DBusGProxy *manager = NULL;
static DBusGConnection *connection = NULL;
static char *finger_name = "any";
static char *finger_name = NULL;
static gboolean g_fatal_warnings = FALSE;
static char **usernames = NULL;
......@@ -99,7 +99,7 @@ static void find_finger(DBusGProxy *dev, const char *username)
g_print(" - #%d: %s\n", i, fingers[i]);
}
if (strcmp (finger_name, "any") == 0) {
if (finger_name == NULL || strcmp (finger_name, "any") == 0) {
g_free (finger_name);
finger_name = g_strdup (fingers[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