httpd-39321

Version:  

httpd 2.2.0

Failure report link:  

https://issues.apache.org/bugzilla/show_bug.cgi?id=39321

How to reproduce the failure?

===Compile====

  1. ./configure --prefix=/XXX/httpd-2.2.0/ --enable-proxy --enable-proxy-http  CFLAGS=-g
  2. make
  3. make install

===Configuration File====

NameVirtualHost *:10086

<VirtualHost *:10086>

   ProxyPass / test5

   ProxyPassReverse / test5

</VirtualHost>

====Run=====

====Debug=====

Symptom:

Segmentation fault.

Root cause:

Null pointer dereference. Actually the fix is simple: check for NULL pointer and simply terminate early!

PROXY_DECLARE(const char *) ap_proxy_add_worker(proxy_worker **worker,   apr_pool_t *p,  proxy_server_conf *conf, const char *url)

{

   rv = apr_uri_parse(p, url, &uri);

   if (rv != APR_SUCCESS) {

       return "Unable to parse URL";

   }

+   if (!uri.hostname || !uri.scheme) {
+        return "URL must be absolute!";
+   }

   ap_str_tolower(uri.hostname);  <-- SegFault!!!  when uri.hostname is null

    ap_str_tolower(uri.scheme);

     …

}

AP_DECLARE(void) ap_str_tolower(char *str)

{

   while (*str) {                             <- segfault

       *str = apr_tolower(*str);

       ++str;

   }

}

Is there Error Message?

Yes.

Can Errlog anticipate the error?

Yes. Using the exception signal pattern.