diff options
author | Vincent Sanders <vince@netsurf-browser.org> | 2011-10-11 07:19:20 +0000 |
---|---|---|
committer | Vincent Sanders <vince@netsurf-browser.org> | 2011-10-11 07:19:20 +0000 |
commit | d628aa06d005a5a09e991907a5be3a3643478c47 (patch) | |
tree | 83fb432d505faccca24cf3eaa4afd03531298842 /content | |
parent | 986720d9d77794e20499935fe2d219d4231f7edb (diff) | |
download | netsurf-d628aa06d005a5a09e991907a5be3a3643478c47.tar.gz netsurf-d628aa06d005a5a09e991907a5be3a3643478c47.tar.bz2 |
fix possible buffer overflow
svn path=/trunk/netsurf/; revision=13032
Diffstat (limited to 'content')
-rw-r--r-- | content/fetchers/about.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/content/fetchers/about.c b/content/fetchers/about.c index ab5f1f6f0..21e97a045 100644 --- a/content/fetchers/about.c +++ b/content/fetchers/about.c @@ -180,6 +180,7 @@ static bool fetch_about_imagecache_handler(struct fetch_about_context *ctx) if (fetch_about_send_header(ctx, "Content-Type: text/html")) goto fetch_about_imagecache_handler_aborted; + /* page head */ slen = snprintf(buffer, sizeof buffer, "<html>\n<head>\n" "<title>NetSurf Browser Image Cache Status</title>\n" @@ -196,12 +197,17 @@ static bool fetch_about_imagecache_handler(struct fetch_about_context *ctx) slen, FETCH_ERROR_NO_ERROR)) goto fetch_about_imagecache_handler_aborted; + /* image cache summary */ slen = image_cache_snsummaryf(buffer, sizeof(buffer), NULL); + if (slen >= (int) (sizeof(buffer))) + goto fetch_about_imagecache_handler_aborted; /* overflow */ if (fetch_about_send_callback(FETCH_DATA, ctx, buffer, slen, FETCH_ERROR_NO_ERROR)) goto fetch_about_imagecache_handler_aborted; + + /* image cache entry table */ slen = snprintf(buffer, sizeof buffer, "<table class=\"config\">\n" "<tr><th>Entry</th><th>Content Key</th><th>Redraw Count</th><th>Conversion Count</th><th>Last Redraw</th><th>Bitmap Age</th><th>Bitmap Size</th></tr>\n"); |