summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlex Dowad <alexinbeijing@gmail.com>2014-04-04 14:56:18 +0200
committerTimo Teräs <timo.teras@iki.fi>2014-04-25 10:14:20 +0300
commit0ad83e2f69e69aeea1ac0baee108c4232449e36d (patch)
treea33c56388319bcbccaffeaca53cfee02e8395dd0
parent184b62e95f19a8eb754d9cc443c332c1b640097c (diff)
downloadsquark-0ad83e2f69e69aeea1ac0baee108c4232449e36d.tar.bz2
squark-0ad83e2f69e69aeea1ac0baee108c4232449e36d.tar.xz
squark-auth-ip: don't segfault if there is an error in the auth DB
-rw-r--r--src/squark-auth-ip.c2
1 files changed, 1 insertions, 1 deletions
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;
}