diff options
author | portix <portix@gmx.net> | 2012-09-30 11:36:22 +0200 |
---|---|---|
committer | portix <portix@gmx.net> | 2012-09-30 11:36:22 +0200 |
commit | 430499af09b0ba3c44ef87c83b67a834b24ac40c (patch) | |
tree | ffb813849417be4eefe5e939485e91b71d910deb /src/adblock.c | |
parent | c07c1a6a5f76cca0861dad25823e2b61ffd5b941 (diff) | |
download | dwb-430499af09b0ba3c44ef87c83b67a834b24ac40c.zip |
Use sizeof for stack-allocated strings; fixing one possible buffer overflow
Diffstat (limited to 'src/adblock.c')
-rw-r--r-- | src/adblock.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/adblock.c b/src/adblock.c index 34b4ce06..bf3c133d 100644 --- a/src/adblock.c +++ b/src/adblock.c @@ -688,7 +688,7 @@ adblock_rule_parse(char *filterlist) { /* currently unsupported xbl, ping, xmlhttprequest, dtd, elemhide, * other, collapse, donottrack, object-subrequest, popup * */ - snprintf(warning, 255, "Adblock option '%s' isn't supported", o); + snprintf(warning, sizeof(warning), "Adblock option '%s' isn't supported", o); adblock_warn_ignored(warning, pattern); goto error_out; } @@ -836,7 +836,7 @@ adblock_init() { if (filterlist == NULL) return false; char buffer[PATH_MAX]; - filterlist = util_expand_home(buffer, filterlist, PATH_MAX); + filterlist = util_expand_home(buffer, filterlist, sizeof(buffer)); if (!g_file_test(filterlist, G_FILE_TEST_EXISTS)) { fprintf(stderr, "Filterlist not found: %s\n", filterlist); return false; |