From: Amos Jeffries Date: Sat, 8 Jul 2017 10:04:48 +0000 (+1200) Subject: Validate mime icon URL before allocating store entries X-Git-Tag: SQUID_3_5_28~9 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=3b1df1f2f24b1f93a501a16f78c2b73f7981056c;p=thirdparty%2Fsquid.git Validate mime icon URL before allocating store entries --- diff --git a/src/mime.cc b/src/mime.cc index ef610e66df..a159dea369 100644 --- a/src/mime.cc +++ b/src/mime.cc @@ -399,6 +399,10 @@ MimeIcon::created(StoreEntry *newEntry) status = Http::scNoContent; } + HttpRequest *r = HttpRequest::CreateFromUrl(url_); + if (!r) + fatalf("mimeLoadIcon: cannot parse internal URL: %s", url_); + // fill newEntry with a canned 2xx response object RequestFlags flags; flags.cachable = true; @@ -407,10 +411,6 @@ MimeIcon::created(StoreEntry *newEntry) EBIT_SET(e->flags, ENTRY_SPECIAL); e->setPublicKey(); e->buffer(); - HttpRequest *r = HttpRequest::CreateFromUrl(url_); - - if (NULL == r) - fatalf("mimeLoadIcon: cannot parse internal URL: %s", url_); e->mem_obj->request = r; HTTPMSGLOCK(e->mem_obj->request);