summaryrefslogtreecommitdiff
path: root/desktop/options.c
diff options
context:
space:
mode:
authorJohn Mark Bell <jmb@netsurf-browser.org>2011-02-21 21:25:47 +0000
committerJohn Mark Bell <jmb@netsurf-browser.org>2011-02-21 21:25:47 +0000
commit63f902e995780463b5805f0721d7db0be7a2cbab (patch)
tree7d7fa59d322cce5bc7102adaa1c55629b41d6fe9 /desktop/options.c
parent66247f5b373f5de9fbaa335bf7c38303ceb79cdc (diff)
downloadnetsurf-63f902e995780463b5805f0721d7db0be7a2cbab.tar.gz
netsurf-63f902e995780463b5805f0721d7db0be7a2cbab.tar.bz2
Fix bug #3188385: ensure that options_snoptionf terminates its output
svn path=/trunk/netsurf/; revision=11749
Diffstat (limited to 'desktop/options.c')
-rw-r--r--desktop/options.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/desktop/options.c b/desktop/options.c
index 091a3b9e5..3ead9be11 100644
--- a/desktop/options.c
+++ b/desktop/options.c
@@ -633,6 +633,10 @@ int options_snoptionf(char *string, size_t size, unsigned int option,
fmtc++;
}
}
+
+ /* Ensure that we NUL-terminate the output */
+ string[min(slen, size - 1)] = '\0';
+
return slen;
}