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: M-staged-PR71~82 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=37cb257b0ca7224c1b556c205f2a9c25a2acc1a3;p=thirdparty%2Fsquid.git Validate mime icon URL before allocating store entries --- diff --git a/src/mime.cc b/src/mime.cc index 063513dcba..7b5b650af9 100644 --- a/src/mime.cc +++ b/src/mime.cc @@ -394,6 +394,11 @@ MimeIcon::created(StoreEntry *newEntry) status = Http::scNoContent; } + const MasterXaction::Pointer mx = new MasterXaction(XactionInitiator::initIcon); + HttpRequestPointer r(HttpRequest::FromUrl(url_, mx)); + if (!r) + fatalf("mimeLoadIcon: cannot parse internal URL: %s", url_); + // fill newEntry with a canned 2xx response object RequestFlags flags; flags.cachable = true; @@ -403,11 +408,6 @@ MimeIcon::created(StoreEntry *newEntry) e->setPublicKey(); e->buffer(); - const MasterXaction::Pointer mx = new MasterXaction(XactionInitiator::initIcon); - HttpRequestPointer r(HttpRequest::FromUrl(url_, mx)); - if (!r) - fatalf("mimeLoadIcon: cannot parse internal URL: %s", url_); - e->mem_obj->request = r; HttpReplyPointer reply(new HttpReply);