Mercurial > hg > icedtea8-forest > jdk
changeset 13761:e56bb18a4dff jdk8u192-b02
Merge
author | alitvinov |
---|---|
date | Mon, 16 Jul 2018 17:49:53 +0100 |
parents | 15ef6431fffc (current diff) 8b12287fc629 (diff) |
children | 53a04f033c36 3d8011a1e021 |
files | .hgtags src/share/classes/sun/security/ssl/SSLContextImpl.java src/share/native/sun/awt/image/BufImgSurfaceData.c src/solaris/native/java/net/Inet4AddressImpl.c src/solaris/native/java/net/Inet6AddressImpl.c src/windows/native/sun/windows/awt_Component.cpp |
diffstat | 30 files changed, 452 insertions(+), 121 deletions(-) [+] |
line wrap: on
line diff
--- a/.hgtags Thu Jul 12 14:13:45 2018 +0530 +++ b/.hgtags Mon Jul 16 17:49:53 2018 +0100 @@ -860,6 +860,7 @@ b6195815c4bbbf275f1aefd337d805eb66f2b5b8 jdk8u171-b00 f1792a59f1fa20e47fe5d4561754012440564bec jdk8u171-b01 cac020298633fc736f5e21afddf00145665ef0a7 jdk8u171-b02 +e7e27f446209924f66a4bf86738f3e5f2fbbef5f jdk8u181-b00 c260afc0c5a13407aad4f066f81fba814bb0cbae jdk8u171-b03 ac700f67341a20ddae093c319da1c65e41edcacd jdk8u171-b04 863ef3413aa42c15fbdc14fef6732f2741f97046 jdk8u171-b05 @@ -881,6 +882,19 @@ f52ece1d8708024735f06e7e3bdc771efbc073d0 jdk8u172-b09 9e9009034e5ce97a97f72c00cd37cf2a638fa1a4 jdk8u172-b10 2a041b1f858dc6a372ac07b8cf5bf6fab879dcc8 jdk8u172-b11 +d902fae6241006af3c4cfc4ce82ebcb3efb9d725 jdk8u181-b01 +baac18e216fb47b4cfa04169b3c3de58d667de7c jdk8u181-b02 +d237c59d14e1c1fb1f750e9cdabcea6e711f4d34 jdk8u181-b03 +6eeca4fb7748e8bdca4afbd6785b04376b1d44cc jdk8u181-b04 +f34c24087b0e6f52391f491d6c3a608616d1db2c jdk8u181-b05 +076f5fd6258846fce7010a598de2c7583628bb1e jdk8u181-b06 +446351642449411566d7fd0a26e32c8825f4f03e jdk8u181-b07 +f26f68978e0e7ed0e6e61f9d64fa2d06f1c1a24c jdk8u181-b08 +71b4f630e5225b9dcb939325f1a2ee0d04dc98f6 jdk8u181-b09 +1f7b9ad2c572fe2c905a771bac15f252e374c2c6 jdk8u181-b10 +112f3576f12e24d5e35d8d31782698e7d9a8fa52 jdk8u181-b11 +22e01e7c5c39bfa3f5e2d18be76c7bf0dc71033a jdk8u181-b12 +0cb452d66676bc1b3824bea4a0c16ac76e58b070 jdk8u181-b13 51b6cc7fbd98a87c6cdb5c70b7dbe25bb10e0dd7 jdk8u182-b00 bead1ed7344f2911f5bed83639cf5160596561ef jdk8u192-b00 444b4528c8ecdd39b5923820fa2ed6d583808b5e jdk8u192-b01
--- a/THIRD_PARTY_README Thu Jul 12 14:13:45 2018 +0530 +++ b/THIRD_PARTY_README Mon Jul 16 17:49:53 2018 +0100 @@ -181,6 +181,192 @@ ------------------------------------------------------------------------------- +%% This notice is provided with respect to DejaVu fonts v2.34, which may be +included with JRE 8, and JDK 8, and OpenJDK 8. + +--- begin of LICENSE --- + +Fonts are (c) Bitstream (see below). DejaVu changes are in public domain. +Glyphs imported from Arev fonts are (c) Tavmjong Bah (see below) + + +Bitstream Vera Fonts Copyright +------------------------------ + +Copyright (c) 2003 by Bitstream, Inc. All Rights Reserved. Bitstream Vera is +a trademark of Bitstream, Inc. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of the fonts accompanying this license ("Fonts") and associated +documentation files (the "Font Software"), to reproduce and distribute the +Font Software, including without limitation the rights to use, copy, merge, +publish, distribute, and/or sell copies of the Font Software, and to permit +persons to whom the Font Software is furnished to do so, subject to the +following conditions: + +The above copyright and trademark notices and this permission notice shall +be included in all copies of one or more of the Font Software typefaces. + +The Font Software may be modified, altered, or added to, and in particular +the designs of glyphs or characters in the Fonts may be modified and +additional glyphs or characters may be added to the Fonts, only if the fonts +are renamed to names not containing either the words "Bitstream" or the word +"Vera". + +This License becomes null and void to the extent applicable to Fonts or Font +Software that has been modified and is distributed under the "Bitstream +Vera" names. + +The Font Software may be sold as part of a larger software package but no +copy of one or more of the Font Software typefaces may be sold by itself. + +THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF COPYRIGHT, PATENT, +TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL BITSTREAM OR THE GNOME +FOUNDATION BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, INCLUDING +ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, +WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF +THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM OTHER DEALINGS IN THE +FONT SOFTWARE. + +Except as contained in this notice, the names of Gnome, the Gnome +Foundation, and Bitstream Inc., shall not be used in advertising or +otherwise to promote the sale, use or other dealings in this Font Software +without prior written authorization from the Gnome Foundation or Bitstream +Inc., respectively. For further information, contact: fonts at gnome dot +org. + +Arev Fonts Copyright +------------------------------ + +Copyright (c) 2006 by Tavmjong Bah. All Rights Reserved. + +Permission is hereby granted, free of charge, to any person obtaining +a copy of the fonts accompanying this license ("Fonts") and +associated documentation files (the "Font Software"), to reproduce +and distribute the modifications to the Bitstream Vera Font Software, +including without limitation the rights to use, copy, merge, publish, +distribute, and/or sell copies of the Font Software, and to permit +persons to whom the Font Software is furnished to do so, subject to +the following conditions: + +The above copyright and trademark notices and this permission notice +shall be included in all copies of one or more of the Font Software +typefaces. + +The Font Software may be modified, altered, or added to, and in +particular the designs of glyphs or characters in the Fonts may be +modified and additional glyphs or characters may be added to the +Fonts, only if the fonts are renamed to names not containing either +the words "Tavmjong Bah" or the word "Arev". + +This License becomes null and void to the extent applicable to Fonts +or Font Software that has been modified and is distributed under the +"Tavmjong Bah Arev" names. + +The Font Software may be sold as part of a larger software package but +no copy of one or more of the Font Software typefaces may be sold by +itself. + +THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT +OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL +TAVMJONG BAH BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, +INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL +DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM +OTHER DEALINGS IN THE FONT SOFTWARE. + +Except as contained in this notice, the name of Tavmjong Bah shall not +be used in advertising or otherwise to promote the sale, use or other +dealings in this Font Software without prior written authorization +from Tavmjong Bah. For further information, contact: tavmjong @ free +. fr. + +TeX Gyre DJV Math +----------------- +Fonts are (c) Bitstream (see below). DejaVu changes are in public domain. + +Math extensions done by B. Jackowski, P. Strzelczyk and P. Pianowski +(on behalf of TeX users groups) are in public domain. + +Letters imported from Euler Fraktur from AMSfonts are (c) American +Mathematical Society (see below). +Bitstream Vera Fonts Copyright +Copyright (c) 2003 by Bitstream, Inc. All Rights Reserved. Bitstream Vera +is a trademark of Bitstream, Inc. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of the fonts accompanying this license ("Fonts") and associated documentation +files (the "Font Software"), to reproduce and distribute the Font Software, +including without limitation the rights to use, copy, merge, publish, +distribute, and/or sell copies of the Font Software, and to permit persons +to whom the Font Software is furnished to do so, subject to the following +conditions: + +The above copyright and trademark notices and this permission notice +shall be included in all copies of one or more of the Font Software typefaces. + +The Font Software may be modified, altered, or added to, and in particular +the designs of glyphs or characters in the Fonts may be modified and +additional glyphs or characters may be added to the Fonts, only if the +fonts are renamed to names not containing either the words "Bitstream" +or the word "Vera". + +This License becomes null and void to the extent applicable to Fonts or +Font Software that has been modified and is distributed under the +"Bitstream Vera" names. + +The Font Software may be sold as part of a larger software package but +no copy of one or more of the Font Software typefaces may be sold by itself. + +THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF COPYRIGHT, PATENT, +TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL BITSTREAM OR THE GNOME +FOUNDATION BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, INCLUDING +ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, +WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT +OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM OTHER DEALINGS IN +THE FONT SOFTWARE. +Except as contained in this notice, the names of GNOME, the GNOME +Foundation, and Bitstream Inc., shall not be used in advertising or +otherwise to promote the sale, use or other dealings in this Font Software +without prior written authorization from the GNOME Foundation or +Bitstream Inc., respectively. +For further information, contact: fonts at gnome dot org. + +AMSFonts (v. 2.2) copyright + +The PostScript Type 1 implementation of the AMSFonts produced by and +previously distributed by Blue Sky Research and Y&Y, Inc. are now freely +available for general use. This has been accomplished through the +cooperation +of a consortium of scientific publishers with Blue Sky Research and Y&Y. +Members of this consortium include: + +Elsevier Science IBM Corporation Society for Industrial and Applied +Mathematics (SIAM) Springer-Verlag American Mathematical Society (AMS) + +In order to assure the authenticity of these fonts, copyright will be +held by the American Mathematical Society. This is not meant to restrict +in any way the legitimate use of the fonts, such as (but not limited to) +electronic distribution of documents containing these fonts, inclusion of +these fonts into other public domain or commercial font collections or computer +applications, use of the outline data to create derivative fonts and/or +faces, etc. However, the AMS does require that the AMS copyright notice be +removed from any derivative versions of the fonts which have been altered in +any way. In addition, to ensure the fidelity of TeX documents using Computer +Modern fonts, Professor Donald Knuth, creator of the Computer Modern faces, +has requested that any alterations which yield different font metrics be +given a different name. + +--- end of LICENSE --- + +------------------------------------------------------------------------------- + %% This notice is provided with respect to Document Object Model (DOM) Level 2 & 3, which may be included with JRE 8, JDK 8, and OpenJDK 8.
--- a/make/CompileDemos.gmk Thu Jul 12 14:13:45 2018 +0530 +++ b/make/CompileDemos.gmk Mon Jul 16 17:49:53 2018 +0100 @@ -455,29 +455,6 @@ ################################################################################################## -ifndef OPENJDK - DB_DEMO_ZIPFILE := $(wildcard $(JDK_TOPDIR)/src/closed/share/db/db-derby-*-bin.zip) - - $(JDK_OUTPUTDIR)/demo/_the.db.unzipped: $(DB_DEMO_ZIPFILE) - $(MKDIR) -p $(@D) - $(RM) -r $(JDK_OUTPUTDIR)/demo/db $(JDK_OUTPUTDIR)/demo/demo - $(CD) $(JDK_OUTPUTDIR)/demo && $(UNZIP) -q -o $< - $(MV) $(JDK_OUTPUTDIR)/demo/db-derby-*-bin/demo $(JDK_OUTPUTDIR)/demo/db - $(CD) $(JDK_OUTPUTDIR)/demo && $(RM) -r db-derby-*-bin - $(TOUCH) $@ - - # Copy this after the unzip above to avoid race with directory creation and mv command. - $(JDK_OUTPUTDIR)/demo/db/README-JDK-DEMOS.html: \ - $(JDK_TOPDIR)/src/closed/share/db/README-JDK-DEMOS.html \ - | $(JDK_OUTPUTDIR)/demo/_the.db.unzipped - $(MKDIR) -p $(@D) - $(CAT) $< | $(SED) "s/XXXX/$(shell cat $(JDK_TOPDIR)/src/closed/share/db/COPYRIGHTYEAR)/" > $@ - - BUILD_DEMOS += $(JDK_OUTPUTDIR)/demo/_the.db.unzipped $(JDK_OUTPUTDIR)/demo/db/README-JDK-DEMOS.html -endif - -################################################################################################## - all: $(BUILD_DEMOS) .PHONY: all
--- a/make/Images.gmk Thu Jul 12 14:13:45 2018 +0530 +++ b/make/Images.gmk Mon Jul 16 17:49:53 2018 +0100 @@ -542,37 +542,6 @@ $(eval $(call AddFileToCopy,$(JDK_OUTPUTDIR),$(JDK_IMAGE_DIR),$f,JDK_SAMPLE_TARGETS))) ################################################################################ -# /db dir - -ifndef OPENJDK - $(IMAGES_OUTPUTDIR)/_unzip/%.unzipped: $(JDK_TOPDIR)/src/closed/share/db/% - $(ECHO) Unzipping $(patsubst $(SRC_ROOT)/%,%,$<) - $(MKDIR) -p $(JDK_IMAGE_DIR)/db - cd $(JDK_IMAGE_DIR)/db && $(UNZIP) -q -o $< -x */index.html */KEYS */test/* *javadoc/* */docs/* */demo/* 2> /dev/null - cd $(JDK_IMAGE_DIR)/db && $(MV) db-derby-*-bin/* . && $(RM) -r db-derby-*-bin -ifneq ($(OPENJDK_TARGET_OS), windows) - $(RM) $(JDK_IMAGE_DIR)/db/bin/*.bat -endif - $(MKDIR) -p $(@D) - $(TOUCH) $@ - - $(JDK_IMAGE_DIR)/db/README-JDK.html: $(JDK_TOPDIR)/src/closed/share/db/README-JDK.html - $(ECHO) $(LOG_INFO) Copying '$(patsubst $(OUTPUT_ROOT)/%,%,$@)' - $(MKDIR) -p $(@D) - $(CAT) $< | $(SED) "s/XXXX/$(shell cat $(JDK_TOPDIR)/src/closed/share/db/COPYRIGHTYEAR)/" > $@ - - $(JDK_IMAGE_DIR)/db/3RDPARTY: $(JDK_TOPDIR)/src/closed/share/db/3RDPARTY - $(ECHO) $(LOG_INFO) Copying '$(patsubst $(OUTPUT_ROOT)/%,%,$@)' - $(MKDIR) -p $(@D) - $(CAT) $< | $(SED) "s/XXXX/$(shell cat $(JDK_TOPDIR)/src/closed/share/db/COPYRIGHTYEAR)/" > $@ - - JDK_DB_TARGETS := $(patsubst $(JDK_TOPDIR)/src/closed/share/db/%, $(IMAGES_OUTPUTDIR)/_unzip/%.unzipped, \ - $(wildcard $(JDK_TOPDIR)/src/closed/share/db/db-derby-*-bin.zip)) \ - $(JDK_IMAGE_DIR)/db/README-JDK.html $(JDK_IMAGE_DIR)/db/3RDPARTY - -endif - -################################################################################ # /include dir $(foreach f,$(call CacheFind,$(JDK_OUTPUTDIR)/include), \
--- a/src/macosx/classes/com/apple/laf/resources/aqua_de.properties Thu Jul 12 14:13:45 2018 +0530 +++ b/src/macosx/classes/com/apple/laf/resources/aqua_de.properties Mon Jul 16 17:49:53 2018 +0100 @@ -1,5 +1,5 @@ # -# Copyright (c) 2011, 2017, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2011, 2018, Oracle and/or its affiliates. All rights reserved. # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # # This code is free software; you can redistribute it and/or modify it @@ -59,7 +59,7 @@ FileChooser.saveTitle.textAndMnemonic=Speichern FileChooser.openTitle.textAndMnemonic=\u00D6ffnen FileChooser.newFolderExistsError.textAndMnemonic=Dieser Name ist bereits vergeben -FileChooser.chooseButton.textAndMnemonic=W\u00E4hlen +FileChooser.chooseButton.textAndMnemonic=Ausw\u00E4hlen FileChooser.newFolderButton.textAndMnemonic=Neuer Ordner FileChooser.newFolderTitle.textAndMnemonic=Neuer Ordner
--- a/src/share/classes/com/sun/jndi/ldap/Connection.java Thu Jul 12 14:13:45 2018 +0530 +++ b/src/share/classes/com/sun/jndi/ldap/Connection.java Mon Jul 16 17:49:53 2018 +0100 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -27,26 +27,27 @@ import java.io.BufferedInputStream; import java.io.BufferedOutputStream; +import java.io.IOException; +import java.io.InputStream; import java.io.InterruptedIOException; -import java.io.IOException; import java.io.OutputStream; -import java.io.InputStream; +import java.lang.reflect.Constructor; +import java.lang.reflect.InvocationTargetException; +import java.lang.reflect.Method; import java.net.Socket; -import javax.net.ssl.SSLSocket; +import java.security.AccessController; +import java.security.PrivilegedAction; +import java.util.Arrays; import javax.naming.CommunicationException; -import javax.naming.ServiceUnavailableException; +import javax.naming.InterruptedNamingException; import javax.naming.NamingException; -import javax.naming.InterruptedNamingException; - +import javax.naming.ServiceUnavailableException; import javax.naming.ldap.Control; +import javax.net.ssl.SSLParameters; +import javax.net.ssl.SSLSocket; -import java.lang.reflect.Method; -import java.lang.reflect.Constructor; -import java.lang.reflect.InvocationTargetException; -import java.util.Arrays; import sun.misc.IOUtils; -//import javax.net.SocketFactory; /** * A thread that creates a connection to an LDAP server. @@ -159,7 +160,18 @@ int readTimeout; int connectTimeout; + private static final boolean IS_HOSTNAME_VERIFICATION_DISABLED + = hostnameVerificationDisabledValue(); + private static boolean hostnameVerificationDisabledValue() { + PrivilegedAction<String> act = () -> System.getProperty( + "com.sun.jndi.ldap.object.disableEndpointIdentification"); + String prop = AccessController.doPrivileged(act); + if (prop == null) { + return false; + } + return prop.isEmpty() ? true : Boolean.parseBoolean(prop); + } // true means v3; false means v2 // Called in LdapClient.authenticate() (which is synchronized) // when connection is "quiet" and not shared; no need to synchronize @@ -368,15 +380,20 @@ // the SSL handshake following socket connection as part of the timeout. // So explicitly set a socket read timeout, trigger the SSL handshake, // then reset the timeout. - if (connectTimeout > 0 && socket instanceof SSLSocket) { + if (socket instanceof SSLSocket) { SSLSocket sslSocket = (SSLSocket) socket; int socketTimeout = sslSocket.getSoTimeout(); - - sslSocket.setSoTimeout(connectTimeout); // reuse full timeout value + if (!IS_HOSTNAME_VERIFICATION_DISABLED) { + SSLParameters param = sslSocket.getSSLParameters(); + param.setEndpointIdentificationAlgorithm("LDAPS"); + sslSocket.setSSLParameters(param); + } + if (connectTimeout > 0) { + sslSocket.setSoTimeout(connectTimeout); // reuse full timeout value + } sslSocket.startHandshake(); sslSocket.setSoTimeout(socketTimeout); } - return socket; }
--- a/src/share/classes/com/sun/rowset/RowSetResourceBundle_de.properties Thu Jul 12 14:13:45 2018 +0530 +++ b/src/share/classes/com/sun/rowset/RowSetResourceBundle_de.properties Mon Jul 16 17:49:53 2018 +0100 @@ -1,5 +1,5 @@ # -# Copyright (c) 2005, 2016, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2005, 2018, Oracle and/or its affiliates. All rights reserved. # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # # This code is free software; you can redistribute it and/or modify it @@ -30,7 +30,7 @@ cachedrowsetimpl.invalidop = Ung\u00FCltiger Vorgang beim Zeileneinf\u00FCgen cachedrowsetimpl.accfailed = acceptChanges nicht erfolgreich cachedrowsetimpl.invalidcp = Ung\u00FCltige Cursorposition -cachedrowsetimpl.illegalop = Ung\u00FCltiger Vorgang bei nicht eingef\u00FCgter Zeile +cachedrowsetimpl.illegalop = Unzul\u00E4ssiger Vorgang bei nicht eingef\u00FCgter Zeile cachedrowsetimpl.clonefail = Klonen nicht erfolgreich: {0} cachedrowsetimpl.invalidcol = Ung\u00FCltiger Spaltenindex cachedrowsetimpl.invalcolnm = Ung\u00FCltiger Spaltenname
--- a/src/share/classes/java/awt/Desktop.java Thu Jul 12 14:13:45 2018 +0530 +++ b/src/share/classes/java/awt/Desktop.java Mon Jul 16 17:49:53 2018 +0100 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, 2006, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -202,15 +202,11 @@ * @throws NullPointerException if file is null * @throws IllegalArgumentException if file doesn't exist */ - private static void checkFileValidation(File file){ - if (file == null) throw new NullPointerException("File must not be null"); - + private static void checkFileValidation(File file) { if (!file.exists()) { throw new IllegalArgumentException("The file: " + file.getPath() + " doesn't exist."); } - - file.canRead(); } /** @@ -264,6 +260,7 @@ * @see java.awt.AWTPermission */ public void open(File file) throws IOException { + file = new File(file.getPath()); checkAWTPermission(); checkExec(); checkActionSupport(Action.OPEN); @@ -295,6 +292,7 @@ * @see java.awt.AWTPermission */ public void edit(File file) throws IOException { + file = new File(file.getPath()); checkAWTPermission(); checkExec(); checkActionSupport(Action.EDIT); @@ -325,6 +323,7 @@ * allowed to create a subprocess */ public void print(File file) throws IOException { + file = new File(file.getPath()); checkExec(); SecurityManager sm = System.getSecurityManager(); if (sm != null) {
--- a/src/share/classes/java/io/ObjectStreamClass.java Thu Jul 12 14:13:45 2018 +0530 +++ b/src/share/classes/java/io/ObjectStreamClass.java Mon Jul 16 17:49:53 2018 +0100 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1996, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1996, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -86,6 +86,18 @@ private static final ObjectStreamField[] serialPersistentFields = NO_FIELDS; + /** true if deserialization constructor checking is disabled */ + private static boolean disableSerialConstructorChecks = + AccessController.doPrivileged( + new PrivilegedAction<Boolean>() { + public Boolean run() { + String prop = "jdk.disableSerialConstructorChecks"; + return "true".equals(System.getProperty(prop)) + ? Boolean.TRUE : Boolean.FALSE; + } + } + ).booleanValue(); + /** reflection factory for obtaining serialization constructors */ private static final ReflectionFactory reflFactory = AccessController.doPrivileged( @@ -1497,6 +1509,46 @@ } /** + * Given a class, determines whether its superclass has + * any constructors that are accessible from the class. + * This is a special purpose method intended to do access + * checking for a serializable class and its superclasses + * up to, but not including, the first non-serializable + * superclass. This also implies that the superclass is + * always non-null, because a serializable class must be a + * class (not an interface) and Object is not serializable. + * + * @param cl the class from which access is checked + * @return whether the superclass has a constructor accessible from cl + */ + private static boolean superHasAccessibleConstructor(Class<?> cl) { + Class<?> superCl = cl.getSuperclass(); + assert Serializable.class.isAssignableFrom(cl); + assert superCl != null; + if (packageEquals(cl, superCl)) { + // accessible if any non-private constructor is found + for (Constructor<?> ctor : superCl.getDeclaredConstructors()) { + if ((ctor.getModifiers() & Modifier.PRIVATE) == 0) { + return true; + } + } + return false; + } else { + // sanity check to ensure the parent is protected or public + if ((superCl.getModifiers() & (Modifier.PROTECTED | Modifier.PUBLIC)) == 0) { + return false; + } + // accessible if any constructor is protected or public + for (Constructor<?> ctor : superCl.getDeclaredConstructors()) { + if ((ctor.getModifiers() & (Modifier.PROTECTED | Modifier.PUBLIC)) != 0) { + return true; + } + } + return false; + } + } + + /** * Returns subclass-accessible no-arg constructor of first non-serializable * superclass, or null if none found. Access checks are disabled on the * returned constructor (if any). @@ -1504,7 +1556,9 @@ private static Constructor<?> getSerializableConstructor(Class<?> cl) { Class<?> initCl = cl; while (Serializable.class.isAssignableFrom(initCl)) { - if ((initCl = initCl.getSuperclass()) == null) { + Class<?> prev = initCl; + if ((initCl = initCl.getSuperclass()) == null || + (!disableSerialConstructorChecks && !superHasAccessibleConstructor(prev))) { return null; } }
--- a/src/share/classes/java/util/regex/PatternSyntaxException.java Thu Jul 12 14:13:45 2018 +0530 +++ b/src/share/classes/java/util/regex/PatternSyntaxException.java Mon Jul 16 17:49:53 2018 +0100 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2008, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -113,7 +113,7 @@ } sb.append(nl); sb.append(pattern); - if (index >= 0) { + if (index >= 0 && pattern != null && index < pattern.length()) { sb.append(nl); for (int i = 0; i < index; i++) sb.append(' '); sb.append('^');
--- a/src/share/classes/sun/rmi/server/resources/rmid_de.properties Thu Jul 12 14:13:45 2018 +0530 +++ b/src/share/classes/sun/rmi/server/resources/rmid_de.properties Mon Jul 16 17:49:53 2018 +0100 @@ -1,6 +1,6 @@ # # -# Copyright (c) 1998, 2013, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 1998, 2018, Oracle and/or its affiliates. All rights reserved. # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # # This code is free software; you can redistribute it and/or modify it @@ -43,7 +43,7 @@ rmid.syntax.log.required=Option -log ist erforderlich # {0} = the (string) illegal argument in question -rmid.syntax.illegal.option=Ung\u00FCltige Option: {0} +rmid.syntax.illegal.option=Unzul\u00E4ssige Option: {0} # {0} = the (string) reason text that came with a thrown exception # "Activation.main" should not be translated, because it's a codepoint
--- a/src/share/classes/sun/security/ssl/SSLContextImpl.java Thu Jul 12 14:13:45 2018 +0530 +++ b/src/share/classes/sun/security/ssl/SSLContextImpl.java Mon Jul 16 17:49:53 2018 +0100 @@ -344,6 +344,13 @@ EnumSet.of(CryptoPrimitive.KEY_AGREEMENT), suite.name, null)) { suites.add(suite); + } else { + if (debug != null && Debug.isOn("sslctx") && + Debug.isOn("verbose")) { + System.out.println( + "Ignoring disabled cipher suite: " + + suite.name); + } } } else if (debug != null && Debug.isOn("sslctx") && Debug.isOn("verbose")) {
--- a/src/share/classes/sun/security/tools/keytool/Resources_de.java Thu Jul 12 14:13:45 2018 +0530 +++ b/src/share/classes/sun/security/tools/keytool/Resources_de.java Mon Jul 16 17:49:53 2018 +0100 @@ -99,7 +99,7 @@ {"destination.alias", "Zielalias"}, //-destalias {"destination.key.password", - "Zielschl\u00FCssel-Kennwort"}, //-destkeypass + "Zielschl\u00FCsselkennwort"}, //-destkeypass {"destination.keystore.name", "Ziel-Keystore-Name"}, //-destkeystore {"destination.keystore.password.protected", @@ -147,7 +147,7 @@ {"source.alias", "Quellalias"}, //-srcalias {"source.key.password", - "Quellschl\u00FCssel-Kennwort"}, //-srckeypass + "Quellschl\u00FCsselkennwort"}, //-srckeypass {"source.keystore.name", "Quell-Keystore-Name"}, //-srckeystore {"source.keystore.password.protected", @@ -178,8 +178,8 @@ "Serielle ID des zu entziehenden Certs"}, //-id // keytool: Running part {"keytool.error.", "Keytool-Fehler: "}, - {"Illegal.option.", "Ung\u00FCltige Option: "}, - {"Illegal.value.", "Ung\u00FCltiger Wert: "}, + {"Illegal.option.", "Unzul\u00E4ssige Option: "}, + {"Illegal.value.", "Unzul\u00E4ssiger Wert: "}, {"Unknown.password.type.", "Unbekannter Kennworttyp: "}, {"Cannot.find.environment.variable.", "Umgebungsvariable kann nicht gefunden werden: "}, @@ -205,7 +205,7 @@ "Wenn der Keystore nicht kennwortgesch\u00FCtzt ist, d\u00FCrfen -storepass, -keypass und -new nicht angegeben werden"}, {"if.source.keystore.is.not.password.protected.then.srcstorepass.and.srckeypass.must.not.be.specified", "Wenn der Quell-Keystore nicht kennwortgesch\u00FCtzt ist, d\u00FCrfen -srcstorepass und -srckeypass nicht angegeben werden"}, - {"Illegal.startdate.value", "Ung\u00FCltiger Wert f\u00FCr Anfangsdatum"}, + {"Illegal.startdate.value", "Unzul\u00E4ssiger Wert f\u00FCr Anfangsdatum"}, {"Validity.must.be.greater.than.zero", "G\u00FCltigkeit muss gr\u00F6\u00DFer als null sein"}, {"provName.not.a.provider", "{0} kein Provider"},
--- a/src/share/classes/sun/security/tools/policytool/Resources_de.java Thu Jul 12 14:13:45 2018 +0530 +++ b/src/share/classes/sun/security/tools/policytool/Resources_de.java Mon Jul 16 17:49:53 2018 +0100 @@ -39,8 +39,8 @@ {"Warning.Class.not.found.class", "Warnung: Klasse nicht gefunden: {0}"}, {"Warning.Invalid.argument.s.for.constructor.arg", "Warnung: Ung\u00FCltige(s) Argument(e) f\u00FCr Constructor: {0}"}, - {"Illegal.Principal.Type.type", "Ung\u00FCltiger Principal-Typ: {0}"}, - {"Illegal.option.option", "Ung\u00FCltige Option: {0}"}, + {"Illegal.Principal.Type.type", "Unzul\u00E4ssiger Principal-Typ: {0}"}, + {"Illegal.option.option", "Unzul\u00E4ssige Option: {0}"}, {"Usage.policytool.options.", "Verwendung: policytool [Optionen]"}, {".file.file.policy.file.location", " [-file <Datei>] Policy-Dateiverzeichnis"},
--- a/src/share/classes/sun/security/util/AuthResources_sv.java Thu Jul 12 14:13:45 2018 +0530 +++ b/src/share/classes/sun/security/util/AuthResources_sv.java Mon Jul 16 17:49:53 2018 +0100 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -88,7 +88,7 @@ {"Keystore.alias.","Nyckellageralias: "}, {"Keystore.password.","Nyckellagerl\u00F6senord: "}, {"Private.key.password.optional.", - "L\u00F6senord f\u00F6r personlig nyckel (valfritt): "}, + "L\u00F6senord f\u00F6r privat nyckel (valfritt): "}, // com.sun.security.auth.module.Krb5LoginModule {"Kerberos.username.defUsername.",
--- a/src/share/classes/sun/tools/jar/resources/jar_de.properties Thu Jul 12 14:13:45 2018 +0530 +++ b/src/share/classes/sun/tools/jar/resources/jar_de.properties Mon Jul 16 17:49:53 2018 +0100 @@ -1,5 +1,5 @@ # -# Copyright (c) 1999, 2015, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 1999, 2018, Oracle and/or its affiliates. All rights reserved. # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # # This code is free software; you can redistribute it and/or modify it @@ -24,7 +24,7 @@ # error.cant.open=\u00D6ffnen nicht m\u00F6glich: {0} -error.illegal.option=Ung\u00FCltige Option: {0} +error.illegal.option=Unzul\u00E4ssige Option: {0} error.bad.option=Eine der Optionen -{ctxu} muss angegeben werden. error.bad.cflag=Kennzeichen "c" erfordert Angabe von Manifest oder Eingabedateien. error.bad.uflag=Kennzeichen "u" erfordert Angabe von Manifest, Kennzeichen "e" oder Eingabedateien.
--- a/src/share/native/common/jni_util.h Thu Jul 12 14:13:45 2018 +0530 +++ b/src/share/native/common/jni_util.h Mon Jul 16 17:49:53 2018 +0100 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -297,6 +297,22 @@ } \ } while (0) \ +#define CHECK_NULL_THROW_NPE(env, x, msg) \ + do { \ + if ((x) == NULL) { \ + JNU_ThrowNullPointerException((env), (msg));\ + return; \ + } \ + } while(0) \ + +#define CHECK_NULL_THROW_NPE_RETURN(env, x, msg, z)\ + do { \ + if ((x) == NULL) { \ + JNU_ThrowNullPointerException((env), (msg));\ + return (z); \ + } \ + } while(0) \ + #define CHECK_NULL_RETURN(x, y) \ do { \ if ((x) == NULL) { \
--- a/src/share/native/java/net/net_util.c Thu Jul 12 14:13:45 2018 +0530 +++ b/src/share/native/java/net/net_util.c Mon Jul 16 17:49:53 2018 +0100 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -168,32 +168,38 @@ void setInetAddress_addr(JNIEnv *env, jobject iaObj, int address) { jobject holder = (*env)->GetObjectField(env, iaObj, ia_holderID); + CHECK_NULL_THROW_NPE(env, holder, "InetAddress holder is null"); (*env)->SetIntField(env, holder, iac_addressID, address); } void setInetAddress_family(JNIEnv *env, jobject iaObj, int family) { jobject holder = (*env)->GetObjectField(env, iaObj, ia_holderID); + CHECK_NULL_THROW_NPE(env, holder, "InetAddress holder is null"); (*env)->SetIntField(env, holder, iac_familyID, family); } void setInetAddress_hostName(JNIEnv *env, jobject iaObj, jobject host) { jobject holder = (*env)->GetObjectField(env, iaObj, ia_holderID); + CHECK_NULL_THROW_NPE(env, holder, "InetAddress holder is null"); (*env)->SetObjectField(env, holder, iac_hostNameID, host); (*env)->SetObjectField(env, holder, iac_origHostNameID, host); } int getInetAddress_addr(JNIEnv *env, jobject iaObj) { jobject holder = (*env)->GetObjectField(env, iaObj, ia_holderID); + CHECK_NULL_THROW_NPE_RETURN(env, holder, "InetAddress holder is null", -1); return (*env)->GetIntField(env, holder, iac_addressID); } int getInetAddress_family(JNIEnv *env, jobject iaObj) { jobject holder = (*env)->GetObjectField(env, iaObj, ia_holderID); + CHECK_NULL_THROW_NPE_RETURN(env, holder, "InetAddress holder is null", -1); return (*env)->GetIntField(env, holder, iac_familyID); } jobject getInetAddress_hostName(JNIEnv *env, jobject iaObj) { jobject holder = (*env)->GetObjectField(env, iaObj, ia_holderID); + CHECK_NULL_THROW_NPE_RETURN(env, holder, "InetAddress holder is null", NULL); return (*env)->GetObjectField(env, holder, iac_hostNameID); } @@ -215,7 +221,9 @@ CHECK_NULL_RETURN(iaObj, NULL); address = NET_IPv4MappedToIPv4(caddr); setInetAddress_addr(env, iaObj, address); + JNU_CHECK_EXCEPTION_RETURN(env, NULL); setInetAddress_family(env, iaObj, IPv4); + JNU_CHECK_EXCEPTION_RETURN(env, NULL); } else { jint scope; int ret; @@ -224,6 +232,7 @@ ret = setInet6Address_ipaddress(env, iaObj, (char *)&(him6->sin6_addr)); CHECK_NULL_RETURN(ret, NULL); setInetAddress_family(env, iaObj, IPv6); + JNU_CHECK_EXCEPTION_RETURN(env, NULL); scope = getScopeID(him); setInet6Address_scopeid(env, iaObj, scope); } @@ -235,7 +244,9 @@ iaObj = (*env)->NewObject(env, ia4_class, ia4_ctrID); CHECK_NULL_RETURN(iaObj, NULL); setInetAddress_family(env, iaObj, IPv4); + JNU_CHECK_EXCEPTION_RETURN(env, NULL); setInetAddress_addr(env, iaObj, ntohl(him4->sin_addr.s_addr)); + JNU_CHECK_EXCEPTION_RETURN(env, NULL); *port = ntohs(him4->sin_port); } return iaObj; @@ -248,6 +259,7 @@ #ifdef AF_INET6 family = getInetAddress_family(env, iaObj) == IPv4? AF_INET : AF_INET6; + JNU_CHECK_EXCEPTION_RETURN(env, JNI_FALSE); if (him->sa_family == AF_INET6) { #ifdef WIN32 struct SOCKADDR_IN6 *him6 = (struct SOCKADDR_IN6 *)him; @@ -263,6 +275,7 @@ } addrNew = NET_IPv4MappedToIPv4(caddrNew); addrCur = getInetAddress_addr(env, iaObj); + JNU_CHECK_EXCEPTION_RETURN(env, JNI_FALSE); if (addrNew == addrCur) { return JNI_TRUE; } else { @@ -294,6 +307,7 @@ } addrNew = ntohl(him4->sin_addr.s_addr); addrCur = getInetAddress_addr(env, iaObj); + JNU_CHECK_EXCEPTION_RETURN(env, JNI_FALSE); if (addrNew == addrCur) { return JNI_TRUE; } else {
--- a/src/solaris/native/java/net/Inet4AddressImpl.c Thu Jul 12 14:13:45 2018 +0530 +++ b/src/solaris/native/java/net/Inet4AddressImpl.c Mon Jul 16 17:49:53 2018 +0100 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -234,7 +234,11 @@ goto cleanupAndReturn; } setInetAddress_addr(env, iaObj, ntohl(((struct sockaddr_in*)(iterator->ai_addr))->sin_addr.s_addr)); + if ((*env)->ExceptionCheck(env)) + goto cleanupAndReturn; setInetAddress_hostName(env, iaObj, name); + if ((*env)->ExceptionCheck(env)) + goto cleanupAndReturn; (*env)->SetObjectArrayElement(env, ret, retLen - i -1, iaObj); i++; iterator = iterator->ai_next; @@ -477,7 +481,11 @@ goto cleanupAndReturn; } setInetAddress_addr(env, iaObj, ntohl(((struct sockaddr_in*)iterator->ai_addr)->sin_addr.s_addr)); + if ((*env)->ExceptionCheck(env)) + goto cleanupAndReturn; setInetAddress_hostName(env, iaObj, host); + if ((*env)->ExceptionCheck(env)) + goto cleanupAndReturn; (*env)->SetObjectArrayElement(env, ret, i++, iaObj); iterator = iterator->ai_next; }
--- a/src/solaris/native/java/net/Inet6AddressImpl.c Thu Jul 12 14:13:45 2018 +0530 +++ b/src/solaris/native/java/net/Inet6AddressImpl.c Mon Jul 16 17:49:53 2018 +0100 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -208,6 +208,8 @@ return NULL; } setInetAddress_hostName(env, o, name); + if ((*env)->ExceptionCheck(env)) + goto done; (*env)->SetObjectArrayElement(env, result, index, o); (*env)->DeleteLocalRef(env, o); } @@ -398,7 +400,11 @@ goto cleanupAndReturn; } setInetAddress_addr(env, iaObj, ntohl(((struct sockaddr_in*)iterator->ai_addr)->sin_addr.s_addr)); + if ((*env)->ExceptionCheck(env)) + goto cleanupAndReturn; setInetAddress_hostName(env, iaObj, host); + if ((*env)->ExceptionCheck(env)) + goto cleanupAndReturn; (*env)->SetObjectArrayElement(env, ret, inetIndex, iaObj); inetIndex++; } else if (iterator->ai_family == AF_INET6) { @@ -420,6 +426,8 @@ setInet6Address_scopeid(env, iaObj, scope); } setInetAddress_hostName(env, iaObj, host); + if ((*env)->ExceptionCheck(env)) + goto cleanupAndReturn; (*env)->SetObjectArrayElement(env, ret, inet6Index, iaObj); inet6Index++; }
--- a/src/solaris/native/java/net/NetworkInterface.c Thu Jul 12 14:13:45 2018 +0530 +++ b/src/solaris/native/java/net/NetworkInterface.c Mon Jul 16 17:49:53 2018 +0100 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -332,14 +332,14 @@ (JNIEnv *env, jclass cls, jobject iaObj) { netif *ifs, *curr; + jobject obj = NULL; + jboolean match = JNI_FALSE; #if defined(AF_INET6) int family = (getInetAddress_family(env, iaObj) == IPv4) ? AF_INET : AF_INET6; + JNU_CHECK_EXCEPTION_RETURN(env, NULL); #else int family = AF_INET; #endif - jobject obj = NULL; - jboolean match = JNI_FALSE; - ifs = enumInterfaces(env); if (ifs == NULL) { return NULL; @@ -357,7 +357,7 @@ int address1 = htonl( ((struct sockaddr_in *)addrP->addr)->sin_addr.s_addr); int address2 = getInetAddress_addr(env, iaObj); - + JNU_CHECK_EXCEPTION_RETURN(env, NULL); if (address1 == address2) { match = JNI_TRUE; break; @@ -703,6 +703,7 @@ if (iaObj) { setInetAddress_addr(env, iaObj, htonl( ((struct sockaddr_in*)addrP->addr)->sin_addr.s_addr)); + JNU_CHECK_EXCEPTION_RETURN(env, NULL); } else { return NULL; } @@ -715,6 +716,7 @@ if (ia2Obj) { setInetAddress_addr(env, ia2Obj, htonl( ((struct sockaddr_in*)addrP->brdcast)->sin_addr.s_addr)); + JNU_CHECK_EXCEPTION_RETURN(env, NULL); (*env)->SetObjectField(env, ibObj, ni_ib4broadcastID, ia2Obj); } else { return NULL;
--- a/src/solaris/native/java/net/PlainDatagramSocketImpl.c Thu Jul 12 14:13:45 2018 +0530 +++ b/src/solaris/native/java/net/PlainDatagramSocketImpl.c Mon Jul 16 17:49:53 2018 +0100 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -569,12 +569,15 @@ iaObj = NET_SockaddrToInetAddress(env, (struct sockaddr *)&remote_addr, &port); #ifdef AF_INET6 family = getInetAddress_family(env, iaObj) == IPv4? AF_INET : AF_INET6; + JNU_CHECK_EXCEPTION_RETURN(env, -1); #else family = AF_INET; #endif if (family == AF_INET) { /* this API can't handle IPV6 addresses */ int address = getInetAddress_addr(env, iaObj); + JNU_CHECK_EXCEPTION_RETURN(env, -1); setInetAddress_addr(env, addressObj, address); + JNU_CHECK_EXCEPTION_RETURN(env, -1); } return port; } @@ -1078,6 +1081,7 @@ struct in_addr in; jobjectArray addrArray; jsize len; + jint family; jobject addr; int i; @@ -1107,8 +1111,12 @@ */ for (i = 0; i < len; i++) { addr = (*env)->GetObjectArrayElement(env, addrArray, i); - if (getInetAddress_family(env, addr) == IPv4) { + family = getInetAddress_family(env, addr); + JNU_CHECK_EXCEPTION(env); + if (family == IPv4) { + JNU_CHECK_EXCEPTION(env); in.s_addr = htonl(getInetAddress_addr(env, addr)); + JNU_CHECK_EXCEPTION(env); break; } } @@ -1162,6 +1170,7 @@ in.s_addr = htonl( getInetAddress_addr(env, value) ); + JNU_CHECK_EXCEPTION(env); if (JVM_SetSockOpt(fd, IPPROTO_IP, IP_MULTICAST_IF, (const char*)&in, sizeof(in)) < 0) { NET_ThrowByNameWithLastError(env, JNU_JAVANETPKG "SocketException", @@ -1528,6 +1537,7 @@ CHECK_NULL_RETURN(addr, NULL); setInetAddress_addr(env, addr, ntohl(in.s_addr)); + JNU_CHECK_EXCEPTION_RETURN(env, NULL); /* * For IP_MULTICAST_IF return InetAddress @@ -1968,6 +1978,7 @@ jobject fdObj = (*env)->GetObjectField(env, this, pdsi_fdID); jint fd; + jint family; jint ipv6_join_leave; if (IS_NULL(fdObj)) { @@ -1989,7 +2000,10 @@ ipv6_join_leave = ipv6_available(); #ifdef __linux__ - if (getInetAddress_family(env, iaObj) == IPv4) { + family = getInetAddress_family(env, iaObj); + JNU_CHECK_EXCEPTION(env); + if (family == IPv4) { + JNU_CHECK_EXCEPTION(env); ipv6_join_leave = JNI_FALSE; } #endif @@ -2037,6 +2051,7 @@ } mname.imr_multiaddr.s_addr = htonl(getInetAddress_addr(env, iaObj)); + JNU_CHECK_EXCEPTION(env); mname.imr_address.s_addr = 0; mname.imr_ifindex = (*env)->GetIntField(env, niObj, ni_indexID); mname_len = sizeof(struct ip_mreqn); @@ -2055,10 +2070,13 @@ addr = (*env)->GetObjectArrayElement(env, addrArray, 0); mname.imr_multiaddr.s_addr = htonl(getInetAddress_addr(env, iaObj)); + JNU_CHECK_EXCEPTION(env); #ifdef __linux__ mname.imr_address.s_addr = htonl(getInetAddress_addr(env, addr)); + JNU_CHECK_EXCEPTION(env); #else mname.imr_interface.s_addr = htonl(getInetAddress_addr(env, addr)); + JNU_CHECK_EXCEPTION(env); #endif mname_len = sizeof(struct ip_mreq); } @@ -2094,6 +2112,7 @@ } mname.imr_multiaddr.s_addr = htonl(getInetAddress_addr(env, iaObj)); + JNU_CHECK_EXCEPTION(env); mname.imr_address.s_addr = 0 ; mname.imr_ifindex = index; mname_len = sizeof(struct ip_mreqn); @@ -2116,6 +2135,7 @@ mname.imr_interface.s_addr = in.s_addr; #endif mname.imr_multiaddr.s_addr = htonl(getInetAddress_addr(env, iaObj)); + JNU_CHECK_EXCEPTION(env); mname_len = sizeof(struct ip_mreq); } } @@ -2181,10 +2201,12 @@ jint family; jint address; family = getInetAddress_family(env, iaObj) == IPv4? AF_INET : AF_INET6; + JNU_CHECK_EXCEPTION(env); if (family == AF_INET) { /* will convert to IPv4-mapped address */ memset((char *) caddr, 0, 16); address = getInetAddress_addr(env, iaObj); + JNU_CHECK_EXCEPTION(env); caddr[10] = 0xff; caddr[11] = 0xff;
--- a/src/solaris/native/java/net/net_util_md.c Thu Jul 12 14:13:45 2018 +0530 +++ b/src/solaris/native/java/net/net_util_md.c Mon Jul 16 17:49:53 2018 +0100 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -786,6 +786,7 @@ int *len, jboolean v4MappedAddress) { jint family; family = getInetAddress_family(env, iaObj); + JNU_CHECK_EXCEPTION_RETURN(env, -1); #ifdef AF_INET6 /* needs work. 1. family 2. clean up him6 etc deallocate memory */ if (ipv6_available() && !(family == IPv4 && v4MappedAddress == JNI_FALSE)) { @@ -797,6 +798,7 @@ if (family == IPv4) { /* will convert to IPv4-mapped address */ memset((char *) caddr, 0, 16); address = getInetAddress_addr(env, iaObj); + JNU_CHECK_EXCEPTION_RETURN(env, -1); if (address == INADDR_ANY) { /* we would always prefer IPv6 wildcard address caddr[10] = 0xff; @@ -905,6 +907,7 @@ } memset((char *) him4, 0, sizeof(struct sockaddr_in)); address = getInetAddress_addr(env, iaObj); + JNU_CHECK_EXCEPTION_RETURN(env, -1); him4->sin_port = htons((short) port); him4->sin_addr.s_addr = (uint32_t) htonl(address); him4->sin_family = AF_INET;
--- a/src/windows/native/java/net/Inet4AddressImpl.c Thu Jul 12 14:13:45 2018 +0530 +++ b/src/windows/native/java/net/Inet4AddressImpl.c Mon Jul 16 17:49:53 2018 +0100 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -195,6 +195,8 @@ goto cleanupAndReturn; } setInetAddress_addr(env, iaObj, ntohl(address)); + if ((*env)->ExceptionCheck(env)) + goto cleanupAndReturn; (*env)->SetObjectArrayElement(env, ret, 0, iaObj); JNU_ReleaseStringPlatformChars(env, host, hostname); return ret; @@ -228,7 +230,11 @@ goto cleanupAndReturn; } setInetAddress_addr(env, iaObj, ntohl((*addrp)->s_addr)); + if ((*env)->ExceptionCheck(env)) + goto cleanupAndReturn; setInetAddress_hostName(env, iaObj, host); + if ((*env)->ExceptionCheck(env)) + goto cleanupAndReturn; (*env)->SetObjectArrayElement(env, ret, i, iaObj); addrp++; i++;
--- a/src/windows/native/java/net/Inet6AddressImpl.c Thu Jul 12 14:13:45 2018 +0530 +++ b/src/windows/native/java/net/Inet6AddressImpl.c Mon Jul 16 17:49:53 2018 +0100 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -219,7 +219,11 @@ goto cleanupAndReturn; } setInetAddress_addr(env, iaObj, ntohl(((struct sockaddr_in*)iterator->ai_addr)->sin_addr.s_addr)); + if ((*env)->ExceptionCheck(env)) + goto cleanupAndReturn; setInetAddress_hostName(env, iaObj, host); + if ((*env)->ExceptionCheck(env)) + goto cleanupAndReturn; (*env)->SetObjectArrayElement(env, ret, inetIndex, iaObj); inetIndex ++; } else if (iterator->ai_family == AF_INET6) { @@ -240,6 +244,8 @@ setInet6Address_scopeid(env, iaObj, scope); } setInetAddress_hostName(env, iaObj, host); + if ((*env)->ExceptionCheck(env)) + goto cleanupAndReturn; (*env)->SetObjectArrayElement(env, ret, inet6Index, iaObj); inet6Index ++; }
--- a/src/windows/native/java/net/NetworkInterface.c Thu Jul 12 14:13:45 2018 +0530 +++ b/src/windows/native/java/net/NetworkInterface.c Mon Jul 16 17:49:53 2018 +0100 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -593,6 +593,7 @@ /* default ctor will set family to AF_INET */ setInetAddress_addr(env, iaObj, ntohl(addrs->addr.him4.sin_addr.s_addr)); + JNU_CHECK_EXCEPTION_RETURN(env, NULL); if (addrs->mask != -1) { ibObj = (*env)->NewObject(env, ni_ibcls, ni_ibctrID); if (ibObj == NULL) { @@ -606,6 +607,7 @@ return NULL; } setInetAddress_addr(env, ia2Obj, ntohl(addrs->brdcast.him4.sin_addr.s_addr)); + JNU_CHECK_EXCEPTION_RETURN(env, NULL); (*env)->SetObjectField(env, ibObj, ni_ibbroadcastID, ia2Obj); (*env)->SetShortField(env, ibObj, ni_ibmaskID, addrs->mask); (*env)->SetObjectArrayElement(env, bindsArr, bind_index++, ibObj); @@ -761,8 +763,9 @@ (JNIEnv *env, jclass cls, jobject iaObj) { netif *ifList, *curr; + jobject netifObj = NULL; jint addr = getInetAddress_addr(env, iaObj); - jobject netifObj = NULL; + JNU_CHECK_EXCEPTION_RETURN(env, NULL); // Retained for now to support IPv4 only stack, java.net.preferIPv4Stack if (ipv6_available()) {
--- a/src/windows/native/java/net/NetworkInterface_winXP.c Thu Jul 12 14:13:45 2018 +0530 +++ b/src/windows/native/java/net/NetworkInterface_winXP.c Mon Jul 16 17:49:53 2018 +0100 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2017, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -552,6 +552,7 @@ setInetAddress_addr(env, iaObj, ntohl(addrs->addr.him4.sin_addr.s_addr)); + JNU_CHECK_EXCEPTION_RETURN(env, NULL); ibObj = (*env)->NewObject(env, ni_ibcls, ni_ibctrID); if (ibObj == NULL) { free_netaddr(netaddrP); @@ -564,6 +565,7 @@ return NULL; } setInetAddress_addr(env, ia2Obj, ntohl(addrs->brdcast.him4.sin_addr.s_addr)); + JNU_CHECK_EXCEPTION_RETURN(env, NULL); (*env)->SetObjectField(env, ibObj, ni_ibbroadcastID, ia2Obj); (*env)->SetShortField(env, ibObj, ni_ibmaskID, addrs->mask); (*env)->SetObjectArrayElement(env, bindsArr, bind_index++, ibObj);
--- a/src/windows/native/java/net/TwoStacksPlainDatagramSocketImpl.c Thu Jul 12 14:13:45 2018 +0530 +++ b/src/windows/native/java/net/TwoStacksPlainDatagramSocketImpl.c Mon Jul 16 17:49:53 2018 +0100 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -439,12 +439,13 @@ memset((char *)&lcladdr, 0, sizeof(lcladdr)); family = getInetAddress_family(env, addressObj); + JNU_CHECK_EXCEPTION(env); if (family == IPv6 && !ipv6_supported) { JNU_ThrowByName(env, JNU_JAVANETPKG "SocketException", "Protocol family not supported"); return; } - + JNU_CHECK_EXCEPTION(env); if (IS_NULL(fdObj) || (ipv6_supported && IS_NULL(fd1Obj))) { JNU_ThrowByName(env, JNU_JAVANETPKG "SocketException", "socket closed"); return; @@ -459,6 +460,7 @@ return; } else { address = getInetAddress_addr(env, addressObj); + JNU_CHECK_EXCEPTION(env); } if (NET_InetAddressToSockaddr(env, addressObj, port, (struct sockaddr *)&lcladdr, &lcladdrlen, JNI_FALSE) != 0) { @@ -562,8 +564,9 @@ } addr = getInetAddress_addr(env, address); - + JNU_CHECK_EXCEPTION(env); family = getInetAddress_family(env, address); + JNU_CHECK_EXCEPTION(env); if (family == IPv6 && !ipv6_supported) { JNU_ThrowByName(env, JNU_JAVANETPKG "SocketException", "Protocol family not supported"); @@ -681,6 +684,7 @@ } family = getInetAddress_family(env, iaObj); + JNU_CHECK_EXCEPTION(env); if (family == IPv4) { fdObj = (*env)->GetObjectField(env, this, pdsi_fdID); } else { @@ -731,6 +735,7 @@ * Check is not necessary on these OSes */ if (connected) { address = getInetAddress_addr(env, iaObj); + JNU_CHECK_EXCEPTION(env); } else { address = ntohl(rmtaddr.him4.sin_addr.s_addr); } @@ -841,6 +846,7 @@ return -1; } else { address = getInetAddress_addr(env, addressObj); + JNU_CHECK_EXCEPTION_RETURN(env, -1); /* We only handle IPv4 for now. Will support IPv6 once its in the os */ family = AF_INET; } @@ -923,7 +929,9 @@ return 0; } setInetAddress_addr(env, addressObj, ntohl(remote_addr.sin_addr.s_addr)); + JNU_CHECK_EXCEPTION_RETURN(env, -1); setInetAddress_family(env, addressObj, IPv4); + JNU_CHECK_EXCEPTION_RETURN(env, -1); /* return port */ return ntohs(remote_addr.sin_port); @@ -1630,6 +1638,7 @@ int fam; addr = (*env)->GetObjectArrayElement(env, addrArray, i); fam = getInetAddress_family(env, addr); + JNU_CHECK_EXCEPTION_RETURN(env, -1); if (fam == family) { *iaddr = addr; return 0; @@ -1648,6 +1657,7 @@ } iaddr->s_addr = htonl(getInetAddress_addr(env, addr)); + JNU_CHECK_EXCEPTION_RETURN(env, -1); return 0; } @@ -1752,6 +1762,7 @@ struct in_addr in; in.s_addr = htonl(getInetAddress_addr(env, value)); + JNU_CHECK_EXCEPTION(env); if (setsockopt(fd, IPPROTO_IP, IP_MULTICAST_IF, (const char*)&in, sizeof(in)) < 0) { NET_ThrowByNameWithLastError(env, JNU_JAVANETPKG "SocketException", @@ -1993,7 +2004,7 @@ CHECK_NULL_RETURN(addr, NULL); setInetAddress_addr(env, addr, ntohl(in.s_addr)); - + JNU_CHECK_EXCEPTION_RETURN(env, NULL); /* * For IP_MULTICAST_IF return InetAddress */
--- a/src/windows/native/java/net/TwoStacksPlainSocketImpl.c Thu Jul 12 14:13:45 2018 +0530 +++ b/src/windows/native/java/net/TwoStacksPlainSocketImpl.c Mon Jul 16 17:49:53 2018 +0100 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -414,6 +414,7 @@ fd1Obj = (*env)->GetObjectField(env, this, psi_fd1ID); family = getInetAddress_family(env, iaObj); + JNU_CHECK_EXCEPTION(env); if (family == IPv6 && !ipv6_supported) { JNU_ThrowByName(env, JNU_JAVANETPKG "SocketException", @@ -731,7 +732,9 @@ } setInetAddress_addr(env, socketAddressObj, ntohl(him.him4.sin_addr.s_addr)); + JNU_CHECK_EXCEPTION(env); setInetAddress_family(env, socketAddressObj, IPv4); + JNU_CHECK_EXCEPTION(env); (*env)->SetObjectField(env, socket, psi_addressID, socketAddressObj); } else { /* AF_INET6 -> Inet6Address */ @@ -758,6 +761,7 @@ } setInet6Address_ipaddress(env, socketAddressObj, (const char *)&him.him6.sin6_addr); setInetAddress_family(env, socketAddressObj, IPv6); + JNU_CHECK_EXCEPTION(env); setInet6Address_scopeid(env, socketAddressObj, him.him6.sin6_scope_id); }
--- a/src/windows/native/java/net/net_util_md.c Thu Jul 12 14:13:45 2018 +0530 +++ b/src/windows/native/java/net/net_util_md.c Mon Jul 16 17:49:53 2018 +0100 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -875,6 +875,7 @@ int *len, jboolean v4MappedAddress) { jint family, iafam; iafam = getInetAddress_family(env, iaObj); + JNU_CHECK_EXCEPTION_RETURN(env, -1); family = (iafam == IPv4)? AF_INET : AF_INET6; if (ipv6_available() && !(family == AF_INET && v4MappedAddress == JNI_FALSE)) { struct SOCKADDR_IN6 *him6 = (struct SOCKADDR_IN6 *)him; @@ -885,6 +886,7 @@ if (family == AF_INET) { /* will convert to IPv4-mapped address */ memset((char *) caddr, 0, 16); address = getInetAddress_addr(env, iaObj); + JNU_CHECK_EXCEPTION_RETURN(env, -1); if (address == INADDR_ANY) { /* we would always prefer IPv6 wildcard address caddr[10] = 0xff; @@ -923,6 +925,7 @@ } memset((char *) him4, 0, sizeof(struct sockaddr_in)); address = getInetAddress_addr(env, iaObj); + JNU_CHECK_EXCEPTION_RETURN(env, -1); him4->sin_port = htons((short) port); him4->sin_addr.s_addr = (u_long) htonl(address); him4->sin_family = AF_INET;