mmanders    2002/12/06 10:54:45

  Modified:    jk/native/apache-2.0 mod_jk.c
  Log:
  Updated jk_handler to check result of call to worker->get_endpoint and handle a 
failure.  This call can fail if the allocation for the endpoint fails because of low 
memory conditions causing a dereference of NULL when we try and access the endpoint.
  
  Revision  Changes    Path
  1.61      +6 -2      jakarta-tomcat-connectors/jk/native/apache-2.0/mod_jk.c
  
  Index: mod_jk.c
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat-connectors/jk/native/apache-2.0/mod_jk.c,v
  retrieving revision 1.60
  retrieving revision 1.61
  diff -u -r1.60 -r1.61
  --- mod_jk.c  25 Nov 2002 16:01:48 -0000      1.60
  +++ mod_jk.c  6 Dec 2002 18:54:45 -0000       1.61
  @@ -1740,7 +1740,9 @@
                                      &jk_cleanup_endpoint,  tpool );
           }
   #else */
  -        worker->get_endpoint(worker, &end, l);
  +        /* worker->get_endpoint might fail if we are out of memory so check */
  +        /* and handle it */
  +        if (worker->get_endpoint(worker, &end, l))
   /* #endif */
           {   
               int is_recoverable_error = JK_FALSE;
  @@ -1767,6 +1769,8 @@
               end->done(&end, l); 
   /* #endif */
                   }
  +                else /* this means we couldn't get an endpoint */
  +                    rc = 0; /* just to make sure that we know we've failed */
               }
   
   #ifndef NO_GETTIMEOFDAY
  
  
  

--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to