[Varnish] #1337: Bad assert causes panic on invalid http status codes

Varnish varnish-bugs at varnish-cache.org
Thu Sep 5 13:33:05 CEST 2013


#1337: Bad assert causes panic on invalid http status codes
-------------------+----------------------
 Reporter:  mha    |       Type:  defect
   Status:  new    |   Priority:  normal
Milestone:         |  Component:  varnishd
  Version:  3.0.4  |   Severity:  major
 Keywords:         |
-------------------+----------------------
 A backend returning http status code 008 (for example) causes varnish to
 panic due to an assert on line 103 of cache_http.c:

 {{{
 const char *
 http_StatusMessage(unsigned status)
 {
         struct http_msg *mp;

         assert(status >= 100 && status <= 999);
         for (mp = http_msg; mp->nbr != 0 && mp->nbr <= status; mp++)
                 if (mp->nbr == status)
                         return (mp->txt);
         return ("Unknown Error");
 }
 }}}


 While this is not a valid http status code, surely the system shouldn't
 panic on that - it should just return an error.

-- 
Ticket URL: <https://www.varnish-cache.org/trac/ticket/1337>
Varnish <https://varnish-cache.org/>
The Varnish HTTP Accelerator




More information about the varnish-bugs mailing list