You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by ma...@apache.org on 2008/08/31 00:52:33 UTC

svn commit: r690600 - /tomcat/connectors/trunk/jni/native/src/address.c

Author: markt
Date: Sat Aug 30 15:52:33 2008
New Revision: 690600

URL: http://svn.apache.org/viewvc?rev=690600&view=rev
Log:
Fix JVM crash on Tomcat start when IPv6 is enabled

Modified:
    tomcat/connectors/trunk/jni/native/src/address.c

Modified: tomcat/connectors/trunk/jni/native/src/address.c
URL: http://svn.apache.org/viewvc/tomcat/connectors/trunk/jni/native/src/address.c?rev=690600&r1=690599&r2=690600&view=diff
==============================================================================
--- tomcat/connectors/trunk/jni/native/src/address.c (original)
+++ tomcat/connectors/trunk/jni/native/src/address.c Sat Aug 30 15:52:33 2008
@@ -48,7 +48,7 @@
 #if APR_HAVE_IPV6
     if (hostname == NULL) {
         /* Try all address using IPV6 one */
-        while (sl) {
+        while (sl && sl->next) {
             if (sl->family == APR_INET6)
                 break; /* Done */
             sl = sl->next;



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


Re: svn commit: r690600 - /tomcat/connectors/trunk/jni/native/src/address.c

Posted by jean-frederic clere <jf...@gmail.com>.
markt@apache.org wrote:
> Author: markt
> Date: Sat Aug 30 15:52:33 2008
> New Revision: 690600
> 
> URL: http://svn.apache.org/viewvc?rev=690600&view=rev
> Log:
> Fix JVM crash on Tomcat start when IPv6 is enabled

-1: If won't work if the there is only one IPv6 address and I don't see 
how that could be the reason of the core.

Cheers

Jean-Frederic

> 
> Modified:
>     tomcat/connectors/trunk/jni/native/src/address.c
> 
> Modified: tomcat/connectors/trunk/jni/native/src/address.c
> URL: http://svn.apache.org/viewvc/tomcat/connectors/trunk/jni/native/src/address.c?rev=690600&r1=690599&r2=690600&view=diff
> ==============================================================================
> --- tomcat/connectors/trunk/jni/native/src/address.c (original)
> +++ tomcat/connectors/trunk/jni/native/src/address.c Sat Aug 30 15:52:33 2008
> @@ -48,7 +48,7 @@
>  #if APR_HAVE_IPV6
>      if (hostname == NULL) {
>          /* Try all address using IPV6 one */
> -        while (sl) {
> +        while (sl && sl->next) {
>              if (sl->family == APR_INET6)
>                  break; /* Done */
>              sl = sl->next;
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: dev-help@tomcat.apache.org
> 
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


Re: svn commit: r690600 - /tomcat/connectors/trunk/jni/native/src/address.c

Posted by Mark Thomas <ma...@apache.org>.
jean-frederic clere wrote:
> markt@apache.org wrote:
>> Author: markt
>> Date: Sat Aug 30 15:52:33 2008
>> New Revision: 690600
>>
>> URL: http://svn.apache.org/viewvc?rev=690600&view=rev
>> Log:
>> Fix JVM crash on Tomcat start when IPv6 is enabled
> 
> Well, I was too fast in my comment...
> In case we don't find an IPv6 returning sa is probably better.
> If a null is returned TC shouldn't crash so we should prevent the crash
> too.

If you want to fix this - go ahead. Your C is much better than mine.

Mark



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


Re: svn commit: r690600 - /tomcat/connectors/trunk/jni/native/src/address.c

Posted by jean-frederic clere <jf...@gmail.com>.
markt@apache.org wrote:
> Author: markt
> Date: Sat Aug 30 15:52:33 2008
> New Revision: 690600
> 
> URL: http://svn.apache.org/viewvc?rev=690600&view=rev
> Log:
> Fix JVM crash on Tomcat start when IPv6 is enabled

Well, I was too fast in my comment...
In case we don't find an IPv6 returning sa is probably better.
If a null is returned TC shouldn't crash so we should prevent the crash too.

Cheers

Jean-Frederic

> 
> Modified:
>     tomcat/connectors/trunk/jni/native/src/address.c
> 
> Modified: tomcat/connectors/trunk/jni/native/src/address.c
> URL: http://svn.apache.org/viewvc/tomcat/connectors/trunk/jni/native/src/address.c?rev=690600&r1=690599&r2=690600&view=diff
> ==============================================================================
> --- tomcat/connectors/trunk/jni/native/src/address.c (original)
> +++ tomcat/connectors/trunk/jni/native/src/address.c Sat Aug 30 15:52:33 2008
> @@ -48,7 +48,7 @@
>  #if APR_HAVE_IPV6
>      if (hostname == NULL) {
>          /* Try all address using IPV6 one */
> -        while (sl) {
> +        while (sl && sl->next) {
>              if (sl->family == APR_INET6)
>                  break; /* Done */
>              sl = sl->next;
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: dev-help@tomcat.apache.org
> 
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org