From d628aa06d005a5a09e991907a5be3a3643478c47 Mon Sep 17 00:00:00 2001 From: Vincent Sanders Date: Tue, 11 Oct 2011 07:19:20 +0000 Subject: fix possible buffer overflow svn path=/trunk/netsurf/; revision=13032 --- content/fetchers/about.c | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'content') 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, "\n\n" "NetSurf Browser Image Cache Status\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, "\n" "\n"); -- cgit v1.2.3
EntryContent KeyRedraw CountConversion CountLast RedrawBitmap AgeBitmap Size