diff options
author | Vincent Sanders <vince@netsurf-browser.org> | 2011-10-12 12:34:11 +0000 |
---|---|---|
committer | Vincent Sanders <vince@netsurf-browser.org> | 2011-10-12 12:34:11 +0000 |
commit | eb9c223f9d61f700ec27cb10b1aa892cd8a2d766 (patch) | |
tree | 03ce51b91908db71f7d06f63cc349ab20c4a2095 /content/fetchers | |
parent | 1badc58b837cef66bdbf615b8d4dc45780c37d3a (diff) | |
download | netsurf-eb9c223f9d61f700ec27cb10b1aa892cd8a2d766.tar.gz netsurf-eb9c223f9d61f700ec27cb10b1aa892cd8a2d766.tar.bz2 |
fix image cache summary information to properly use a format string
remove snprintf buffer overflow possibility
fix the about:imagecache fetcher to contain the output formatting and use summary information formatting
svn path=/trunk/netsurf/; revision=13039
Diffstat (limited to 'content/fetchers')
-rw-r--r-- | content/fetchers/about.c | 24 |
1 files changed, 22 insertions, 2 deletions
diff --git a/content/fetchers/about.c b/content/fetchers/about.c index 21e97a045..7ffe52db2 100644 --- a/content/fetchers/about.c +++ b/content/fetchers/about.c @@ -198,7 +198,21 @@ static bool fetch_about_imagecache_handler(struct fetch_about_context *ctx) goto fetch_about_imagecache_handler_aborted; /* image cache summary */ - slen = image_cache_snsummaryf(buffer, sizeof(buffer), NULL); + slen = image_cache_snsummaryf(buffer, sizeof(buffer), + "<p>Configured limit of %a hysteresis of %b" + "<p>Total bitmap size in use %c (in %d)" + "<p>Age %es" + "<p>Peak size %f (in %g)" + "<p>Peak image count %h (size %i)" + "<p>Cache total/hit/miss/fail (counts) %j/%k/%l/%m " + "(%pj%%/%pk%%/%pl%%/%pm%%)" + "<p>Cache total/hit/miss/fail (size) %n/%o/%q/%r " + "(%pn%%/%po%%/%pq%%/%pr%%)" + "<p>Total images never rendered: %s " + "(includes %t that were converted)" + "<p>Total number of excessive conversions: %u " + "(from %v images converted more than once)" + "<p>Bitmap of size %w had most (%x) conversions"); if (slen >= (int) (sizeof(buffer))) goto fetch_about_imagecache_handler_aborted; /* overflow */ @@ -210,7 +224,13 @@ static bool fetch_about_imagecache_handler(struct fetch_about_context *ctx) /* 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"); + "<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"); do { res = image_cache_snentryf(buffer + slen, sizeof buffer - slen, cent_loop, |