changeset 9243:1357577b1a7e

8033689: PlainDatagramSocketImpl missing returns after throwing an exception Reviewed-by: michaelm
author chegar
date Wed, 05 Feb 2014 14:14:46 +0000
parents ce48a9174170
children 7ac57cd90f7c
files src/solaris/native/java/net/PlainDatagramSocketImpl.c
diffstat 1 files changed, 4 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/src/solaris/native/java/net/PlainDatagramSocketImpl.c	Wed Feb 05 14:21:10 2014 +0100
+++ b/src/solaris/native/java/net/PlainDatagramSocketImpl.c	Wed Feb 05 14:14:46 2014 +0000
@@ -506,6 +506,7 @@
     }
     if (IS_NULL(addressObj)) {
         JNU_ThrowNullPointerException(env, "Null address in peek()");
+        return -1;
     }
     if (timeout) {
         int ret = NET_Timeout(fd, timeout);
@@ -1419,7 +1420,7 @@
         default :
             JNU_ThrowByName(env, JNU_JAVANETPKG "SocketException",
                 "Socket option not supported by PlainDatagramSocketImp");
-            break;
+            return;
 
     }
 
@@ -1833,6 +1834,7 @@
 #ifdef AF_INET6
 #ifdef __linux__
     setTTL(env, fd, ttl);
+    JNU_CHECK_EXCEPTION(env);
     if (ipv6_available()) {
         setHopLimit(env, fd, ttl);
     }
@@ -2120,6 +2122,7 @@
                     else
                         NET_ThrowCurrent(env, "setsockopt IP_DROP_MEMBERSHIP failed");
                 }
+                return;
             }
         }