From 28d71e825f122379feaa0a5231c72719dbbe459a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timo=20Ter=C3=A4s?= Date: Mon, 12 Nov 2012 15:51:09 +0200 Subject: squark-filter: fix path component lookup Do not do string literal lookup unless the path parent matches. This avoids wrong string literal lookups when the path does not exist and refers actuall to an entry which is IPv4 encoded (parent == SQDB_PARENT_IPV4). --- src/squark-filter.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/squark-filter.c b/src/squark-filter.c index c8e4f18..50b96de 100644 --- a/src/squark-filter.c +++ b/src/squark-filter.c @@ -294,8 +294,8 @@ static int url_classify(struct url_info *url, struct sqdb *db) previ = i; i = cmph_search_packed(cmph, key.ptr, key.len); - tld = sqdb_get_string_literal(db, indx[i].component); - if (blob_cmp(got, sqdb_get_string_literal(db, indx[i].component)) != 0) { + if (indx[i].parent != previ || + blob_cmp(got, sqdb_get_string_literal(db, indx[i].component)) != 0) { /* the subdomain did no longer match, use * parents classification */ i = previ; -- cgit v1.2.3