[Fingerforce-commits] [fprintd] 07/12: tests: Fix segfault in verify when used without -f
Didier Raboud
odyx at moszumanska.debian.org
Sun Apr 12 13:12:06 UTC 2015
This is an automated email from the git hooks/post-receive script.
odyx pushed a commit to branch master
in repository fprintd.
commit f7c51b0d585eb63702f0d005081e53f44325df86
Author: Volkau Siarhei <lis82 at mail.by>
Date: Sat Nov 1 15:28:00 2014 +0000
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
---
tests/verify.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/tests/verify.c b/tests/verify.c
index af953b0..f3d04cd 100644
--- a/tests/verify.c
+++ b/tests/verify.c
@@ -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]);
}
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/fingerforce/fprintd.git
More information about the Fingerforce-commits
mailing list