From 0ad83e2f69e69aeea1ac0baee108c4232449e36d Mon Sep 17 00:00:00 2001 From: Alex Dowad Date: Fri, 4 Apr 2014 14:56:18 +0200 Subject: squark-auth-ip: don't segfault if there is an error in the auth DB --- src/squark-auth-ip.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/squark-auth-ip.c') diff --git a/src/squark-auth-ip.c b/src/squark-auth-ip.c index 38e1f0b..9b6ab15 100644 --- a/src/squark-auth-ip.c +++ b/src/squark-auth-ip.c @@ -49,7 +49,7 @@ static void handle_line(blob_t line) if (addr_parse(ipaddr, &addr)) { token = authdb_get(&adb, &addr, &entry, 1); - if (authdb_check_login(token, &entry, BLOB_NULL, now, &adbc)) + if (token != NULL && authdb_check_login(token, &entry, BLOB_NULL, now, &adbc)) auth_ok = 1; } -- cgit v1.2.3