diff options
author | Timo Teräs <timo.teras@iki.fi> | 2014-11-27 15:48:01 +0200 |
---|---|---|
committer | Timo Teräs <timo.teras@iki.fi> | 2014-11-27 15:48:33 +0200 |
commit | e4209186efe7e176b3053e66c54d84f3d0ceb9c7 (patch) | |
tree | 64e06c8786ca3249e53e4f004401ebe87d1712be /main/squark/0002-filter-default-path-is-const-and-thus-non-writable.patch | |
parent | 687eb6d7542443fa3a1f3c89bd71e2572d59610f (diff) | |
download | aports-e4209186efe7e176b3053e66c54d84f3d0ceb9c7.tar.bz2 aports-e4209186efe7e176b3053e66c54d84f3d0ceb9c7.tar.xz |
main/squark: fix crash in classification of certain urls
Diffstat (limited to 'main/squark/0002-filter-default-path-is-const-and-thus-non-writable.patch')
-rw-r--r-- | main/squark/0002-filter-default-path-is-const-and-thus-non-writable.patch | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/main/squark/0002-filter-default-path-is-const-and-thus-non-writable.patch b/main/squark/0002-filter-default-path-is-const-and-thus-non-writable.patch new file mode 100644 index 0000000000..fe3fb1bf48 --- /dev/null +++ b/main/squark/0002-filter-default-path-is-const-and-thus-non-writable.patch @@ -0,0 +1,37 @@ +From bdb5a17e3570ee5bde564f894444125be16a233c Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Timo=20Ter=C3=A4s?= <timo.teras@iki.fi> +Date: Thu, 27 Nov 2014 15:45:31 +0200 +Subject: [PATCH] filter: default path is const and thus non-writable + +fix crash that would happen in blob_lowercase due to trying to +write rodata. +--- + src/squark-filter.c | 5 ++--- + 1 file changed, 2 insertions(+), 3 deletions(-) + +diff --git a/src/squark-filter.c b/src/squark-filter.c +index 827540e..5ffcedf 100644 +--- a/src/squark-filter.c ++++ b/src/squark-filter.c +@@ -168,8 +168,7 @@ static int url_parse(blob_t uri, struct url_info *nfo) + else + nfo->port = 80; + } +- if (blob_is_null(nfo->path)) +- nfo->path = BLOB_STR("/"); ++ if (blob_is_null(nfo->path)) nfo->path = slash; + + /* significant host name */ + nfo->significant_host = nfo->host; +@@ -275,7 +274,7 @@ static int url_classify(struct url_info *url, struct sqdb *db) + + /* and then search for path matches -- construct hashing + * string of url decoded path */ +- blob_lowercase(url->path); /* filter DB stores all URLs in lowercase */ ++ if (url->path.ptr != slash.ptr) blob_lowercase(url->path); /* filter DB stores all URLs in lowercase */ + blob_push_urldecode(&keybuf, url->path); + keylimits = blob_pushed(BLOB_BUF(buffer), keybuf); + +-- +2.2.0 + |