diff --git a/.gitignore b/.gitignore index ddba224..a9a764d 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,2 @@ -SOURCES/shenandoah8u482-b08.tar.xz +SOURCES/shenandoah8u504-b01.tar.xz SOURCES/tapsets-icedtea-3.15.0.tar.xz diff --git a/.java-1.8.0-openjdk.metadata b/.java-1.8.0-openjdk.metadata index 67e6680..9fc5cb1 100644 --- a/.java-1.8.0-openjdk.metadata +++ b/.java-1.8.0-openjdk.metadata @@ -1,2 +1,2 @@ -13abceddc732a35f2dbe547d15bb19b8aa1ab677 SOURCES/shenandoah8u482-b08.tar.xz +e6dc98449c2b4373860d81e758d4fd764df8bc05 SOURCES/shenandoah8u504-b01.tar.xz 7ae2cba67467825b2c2a5fec7aea041865023002 SOURCES/tapsets-icedtea-3.15.0.tar.xz diff --git a/SOURCES/NEWS b/SOURCES/NEWS index d43651e..1f82abc 100644 --- a/SOURCES/NEWS +++ b/SOURCES/NEWS @@ -3,11 +3,256 @@ Key: JDK-X - https://bugs.openjdk.java.net/browse/JDK-X CVE-XXXX-YYYY: https://cve.mitre.org/cgi-bin/cvename.cgi?name=XXXX-YYYY +New in release OpenJDK 8u504 (2026-08-18): +=========================================== +Live versions of these release notes can be found at: + * https://bit.ly/openjdk8u504 + +* CVEs + - CVE-2026-60589 + - CVE-2026-61308 + - CVE-2026-70907 +* Changes + - JDK-8382471: Improve Resource Resolving + - JDK-8384708: Enhance HTTP Connections + - JDK-8385390: Update FreeType to 2.14.3 + - JDK-8386205: Enhance TLS server + - JDK-8388811: [8u] VS2010 build broken by JDK-8374058 + - JDK-8389477: Bump update version for OpenJDK: 8u504 + +New in release OpenJDK 8u502 (2026-07-21): +=========================================== +Live versions of these release notes can be found at: + * https://bit.ly/openjdk8u502 + +* CVEs + - CVE-2026-46968 + - CVE-2026-47010 + - CVE-2026-47021 + - CVE-2026-47027 + - CVE-2026-60147 + - CVE-2026-47059 + - CVE-2026-47063 + - CVE-2026-47057 + - CVE-2026-47058 + - CVE-2026-41254 +* Changes + - JDK-6815126: intermittent SimulResumerTest.java failure + - JDK-8162545: Mac build failure + - JDK-8199138: Add RISC-V support to Zero + - JDK-8209362: sun/security/ssl/SSLSocketImpl/ReuseAddr.java failed due to "BindException: Address already in use (Bind failed)" + - JDK-8246330: Add TLS Tests for Legacy ECDSA curves + - JDK-8249159: Downport test rework for SSLSocketTemplate from 8224650 + - JDK-8261235: C1 compilation fails with assert(res->vreg_number() == index) failed: conversion check + - JDK-8273135: java/awt/color/ICC_ColorSpace/MTTransformReplacedProfile.java crashes in liblcms.dylib with NULLSeek+0x7 + - JDK-8274736: Concurrent read/close of SSLSockets causes SSLSessions to be invalidated unnecessarily + - JDK-8280158: New test from JDK-8274736 failed with/without patch in JDK11u + - JDK-8298873: Update IllegalRecordVersion.java for changes to TLS implementation + - JDK-8301189: validate-source fails after JDK-8298873 + - JDK-8314730: GHA: Drop libfreetype6-dev transitional package in favor of libfreetype-dev + - JDK-8321489: Update LCMS to 2.16 + - JDK-8336451: [11u] GHA macos-13 and macos-15 builders are unable to resolve local hostname + - JDK-8348110: Update LCMS to 2.17 + - JDK-8351359: OperatingSystemMXBean: values from getCpuLoad and getProcessCpuLoad are stale after 24.8 days (Windows) + - JDK-8363966: GHA: Switch cross-compiling sysroots to Debian trixie + - JDK-8368041: Enhance TLS certificate handling + - JDK-8369996: Testcase java/net/Socket/B8312065.java fails on Mac, AIX and Solaris + - JDK-8372351: Add 2 WISeKey roots + - JDK-8374058: Enhance JPEG handling + - JDK-8374888: Implement internal test cache to help UserIterCount test performance + - JDK-8375065: Update LCMS to 2.18 + - JDK-8377158: Enhance XBM image support + - JDK-8377498: Improve HttpServer handling + - JDK-8377833: Enhance Jar file processing + - JDK-8378631: Update Zlib Data Compression Library to Version 1.3.2 + - JDK-8378687: Improve delegation of HttpURLConnection + - JDK-8379684: Bump update version of OpenJDK: 8u502 + - JDK-8380377: [8u] Problem list CAInterop.java#teliarootcav2 + - JDK-8380672: Improve certification checking + - JDK-8380689: distrust/Chunghwa.java test fails with a compilation error + - JDK-8380947: Add pull request template + - JDK-8381039: Enhance AWT ImagingLib + - JDK-8381049: Enhance Jar handling + - JDK-8381185: Improve Nashorn index handling + - JDK-8381195: Enhance Dataview Implementation + - JDK-8381519: Enhance Der Value Handling + - JDK-8381796: Enhance Certificate parsing + - JDK-8383175: (tz) Update Timezone Data to 2026b + - JDK-8383354: Update LCMS to 2.19.1 + - JDK-8383473: Follow on from tzdata2026b time change to include temporary hack BC time change + - JDK-8384158: GHA: Downgrade Windows GHA runners to windows-2022 temporarily + +security-libs/java.security: + +JDK-8372351: Add 2 WISeKey roots +================================ +The following root certificates have been added to the cacerts +truststore: + +Alias Name: wisekeyglobalrootgbca +Distinguished Name: CN=OISTE WISeKey Global Root GB CA, OU=OISTE Foundation Endorsed, O=WISeKey, C=CH +Serial Number: 76b1205274f0858746b3f8231af6c2c0 +Valid From: Mon Dec 01 15:00:32 GMT 2014 +Valid Until: Thu Dec 01 15:10:31 GMT 2039 + +Alias Name: wisekeyglobalrootgcca +Distinguished Name: CN=OISTE WISeKey Global Root GC CA, OU=OISTE Foundation Endorsed, O=WISeKey, C=CH +Serial Number: 212a560caeda0cab4045bf2ba22d3aea +Valid From: Tue May 09 09:48:34 GMT 2017 +Valid Until: Fri May 09 09:58:33 GMT 2042 + +JDK-8381796: Enhance Certificate parsing +======================================== +With this release of OpenJDK, a security and system property +`com.sun.security.crl.maxSize` is introduced which acts as a maximum +size limit on a Certificate Revocation List (CRL) downloaded over the +network. For URICertStore requests, the value is the maximum size in +bytes of the DER-encoded CRL. For LDAPCertStore queries, the +threshold is the sum of all CRLs downloaded from a single search. By +default, the maximum size is 20MiB (20971520 bytes) and CRLs larger +than this will be discarded. A value less than zero may be used to +turn off the size limit and non-numeric values will be ignored. A +non-empty value for the system property takes precedence over the +security property. Enabling 'certpath' debug logging will output the +current size limit and note any discarded CRLs. + +New in release OpenJDK 8u492 (2026-04-21): +=========================================== +Live versions of these release notes can be found at: + * https://bit.ly/openjdk8u492 + +* CVEs + - CVE-2026-22007 + - CVE-2026-22013 + - CVE-2026-22016 + - CVE-2026-22018 + - CVE-2026-22021 + - CVE-2026-23865 + - CVE-2026-34268 +* Changes + - JDK-8056039: Hotspot does not compile with clang 3.4 on Linux + - JDK-8074840: Resolve disabled warnings for libjli and libjli_static + - JDK-8132786: java/security/cert/CertPathValidator/OCSP/AIACheck.java fails intermittently + - JDK-8153147: Mark java/net/BindException/Test.java as intermittently failing + - JDK-8157758: JDK9 does not compile on Linux with GCC 6.1 because left-shifting a negative number has undefined behavior + - JDK-8170464: Remove shell script from compiler/c2/cr7005594/Test7005594.java + - JDK-8174734: Safepoint sync time did not increase + - JDK-8186149: quarantine gc/survivorAlignment/TestPromotionFromSurvivorToTenuredAfterMinorGC.java + - JDK-8220658: Improve the readability of container information in the error log + - JDK-8223145: Replace wildcard address with loopback or local host in tests - part 1 + - JDK-8225487: giflib legal file is missing attribution for openbsd-reallocarray.c. + - JDK-8237834: com/sun/jndi/ldap/LdapDnsProviderTest.java failing with LDAP response read timeout + - JDK-8251189: com/sun/jndi/ldap/LdapDnsProviderTest.java failed due to timeout + - JDK-8264524: jdk/internal/platform/docker/TestDockerMemoryMetrics.java fails due to swapping not working + - JDK-8274893: Update java.desktop classes to use try-with-resources + - JDK-8277159: Fix java/nio/file/FileStore/Basic.java test by ignoring /run/user/* mount points + - JDK-8284758: [linux] improve print_container_info + - JDK-8285836: sun/net/www/http/KeepAliveCache/KeepAliveProperty.java failed with "RuntimeException: Failed in server" + - JDK-8287011: Improve container information + - JDK-8303482: Update LCMS to 2.15 + - JDK-8312518: [macos13] setFullScreenWindow() shows black screen on macOS 13 & above + - JDK-8313770: jdk/internal/platform/docker/TestSystemMetrics.java fails on Ubuntu + - JDK-8328999: Update GIFlib to 5.2.2 + - JDK-8339271: giflib attribution correction + - JDK-8343622: AesDkCrypto.stringToKey should not return null + - JDK-8345578: New test in JDK-8343622 fails with a promoted build + - JDK-8347911: Limit the length of inflated text chunks + - JDK-8348014: Enhance certificate processing + - JDK-8350813: Rendering of bulky sound bank from MIDI sequence can cause OutOfMemoryError + - JDK-8353657: [8u] Test tools/launcher/VersionCheck.java fails with debug build + - JDK-8360869: jcstress is able to crash jdk8 on aarch64 with jfr on + - JDK-8361748: Enforce limits on the size of an XBM image + - JDK-8364373: Transform Affine transformations + - JDK-8364465: Enhance behavior of some intrinsics + - JDK-8369226: GHA: Switch to MacOS 15 + - JDK-8369282: Distrust TLS server certificates anchored by Chunghwa ePKI Root CA + - JDK-8369575: Enhance crypto algorithm support + - JDK-8370529: Enhance Path Factories Redux + - JDK-8370615: Improve Kerberos credentialing + - JDK-8370986: Enhance Zip file reading + - JDK-8370995: Enhance ZipFile usage + - JDK-8371830: Enhance certificate chain validation + - JDK-8371935: Enhance key generation + - JDK-8372660: [8u] ProblemList TestCPUAwareness until 8370492 is addressed + - JDK-8373250: Bump update version of OpenJDK: 8u492 + - JDK-8373290: Update FreeType to 2.14.1 + - JDK-8373476: (tz) Update Timezone Data to 2025c + - JDK-8373727: New XBM images parser regression: only the first line of the bitmap array is parsed + - JDK-8374899: [8u] Fully handle clang as the toolchain in flags.m4 + - JDK-8374917: [8u] C++ flags get passed to C compiles in the HotSpot build + - JDK-8374948: [8u] saproc & jsig builds add duplicate linker flags on Darwin/MacOS + - JDK-8375063: Update Libpng to 1.6.54 + - JDK-8375189: [8u] Problem list CAInterop.java#microsoftrsa2017 + - JDK-8376225: [8u] GHA: Apply work-around for missing JNF for MacOSX builds + - JDK-8376272: [8u] Windows x86-32 fails to build after JDK-8359501 + - JDK-8376338: Test7005594.sh fails when given a memory value with decimals + - JDK-8376352: [8u] Build failure on Windows 32-bit after JDK-8362308 + - JDK-8377344: [8u] Compilation failure on Windows for Linux-specific platform metric tests + - JDK-8377526: Update Libpng to 1.6.55 + - JDK-8379035: (tz) Update Timezone Data to 2026a + - JDK-8379158: Update FreeType to 2.14.2 + - JDK-8379256: Update GIFlib to 6.1.1 + - JDK-8380078: Update GIFlib to 6.1.2 + - JDK-8380959: Update Libpng to 1.6.56 + - JDK-8382047: Update Libpng to 1.6.57 + +Notes on individual issues: +=========================== + +security-libs/javax.net.ssl: + +JDK-8369282: Distrust TLS server certificates anchored by Chunghwa ePKI Root CA +=============================================================================== +In accordance with similar plans recently announced by Google and +Mozilla, the JDK will not trust Transport Layer Security (TLS) +certificates issued after the 17th of March 2026 which are anchored by +Chungwa root certificates. + +Certificates issued on or before the 17th of March, 2026 will continue +to be trusted until they expire. + +If a server's certificate chain is anchored by an affected +certificate, attempts to negotiate a TLS session will fail with an +Exception that indicates the trust anchor is not trusted. For example, + +"TLS server certificate issued after 2026-03-17 and anchored by a +distrusted legacy Chungwa root CA: OU=ePKI Root Certification +Authority, O="Chunghwa Telecom Co.", Ltd. C=TW" + +To check whether a certificate in a JDK keystore is affected by this +change, you can the `keytool` utility: + +keytool -v -list -alias -keystore + +If any of the certificates in the chain are affected by this change, +then you will need to update the certificate or contact the +organisation responsible for managing the certificate. + +These restrictions apply to the following Chungwa root certificates +included in the JDK: + +Alias name: chunghwaepkirootca +OU=ePKI Root Certification Authority +O="Chunghwa Telecom Co., Ltd." +C=TW +SHA256:A6:F4:DC:63:A2:4B:FD:CF:54:EF:2A:6A:08:2A:0A:72:DE:35:80:3E:2F:F5:FF:52:7A:E5:D8:72:06:DF:D5 + +Users can, *at their own risk*, remove this restriction by modifying +the `java.security` configuration file (or override it by using the +`java.security.properties` system property) so "CHUNGWA_TLS" is no +longer listed in the `jdk.security.caDistrustPolicies` security +property. + New in release OpenJDK 8u482 (2026-01-20): =========================================== Live versions of these release notes can be found at: * https://bit.ly/openjdk8u482 +* CVEs + - CVE-2026-21925 + - CVE-2026-21932 + - CVE-2026-21933 + - CVE-2026-21945 * Changes - JDK-8154043: Fields not reachable anymore by tab-key, because of new tabbing behaviour of radio button groups. - JDK-8182577: Exception when Tab key moves focus to a JCheckbox with a custom ButtonModel diff --git a/SOURCES/TestTranslations.java b/SOURCES/TestTranslations.java index 199d765..88e689c 100644 --- a/SOURCES/TestTranslations.java +++ b/SOURCES/TestTranslations.java @@ -1,5 +1,5 @@ /* TestTranslations -- Ensure translations are available for new timezones - Copyright (C) 2022 Red Hat, Inc. + Copyright (C) 2026 Red Hat, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as @@ -60,15 +60,34 @@ public class TestTranslations { public static void main(String[] args) { + boolean debug = false; + if (args.length < 1) { System.err.println("Test must be started with the name of the locale provider."); System.exit(1); } + if (args.length > 1) { + debug = Boolean.parseBoolean(args[1]); + } + + System.err.printf("Debugging: %s\n", debug); + + testZoneStrings(debug); + + String localeProvider = args[0]; + testZone(localeProvider, KYIV, + new String[] { "Europe/Kiev", "Europe/Kyiv", "Europe/Uzhgorod", "Europe/Zaporozhye" }); + testZone(localeProvider, CIUDAD_JUAREZ, + new String[] { "America/Cambridge_Bay", "America/Ciudad_Juarez" }); + } + + private static void testZoneStrings(final boolean debug) { System.out.println("Checking sanity of full zone string set..."); boolean invalid = Arrays.stream(Locale.getAvailableLocales()) - .peek(l -> System.out.println("Locale: " + l)) + .peek(l -> System.out.printf(debug ? "Locale: %s\n" : "", l)) .map(l -> DateFormatSymbols.getInstance(l).getZoneStrings()) + .peek(df -> System.out.printf(debug ? "Zone string size: %s\n" : "", df.length)) .flatMap(zs -> Arrays.stream(zs)) .flatMap(names -> Arrays.stream(names)) .filter(name -> Objects.isNull(name) || name.isEmpty()) @@ -78,12 +97,6 @@ public class TestTranslations { System.err.println("Zone string for a locale returned null or empty string"); System.exit(2); } - - String localeProvider = args[0]; - testZone(localeProvider, KYIV, - new String[] { "Europe/Kiev", "Europe/Kyiv", "Europe/Uzhgorod", "Europe/Zaporozhye" }); - testZone(localeProvider, CIUDAD_JUAREZ, - new String[] { "America/Cambridge_Bay", "America/Ciudad_Juarez" }); } private static void testZone(String localeProvider, Map exp, String[] ids) { diff --git a/SOURCES/java-1.8.0-openjdk-portable.specfile b/SOURCES/java-1.8.0-openjdk-portable.specfile index f5318fb..55d4133 100644 --- a/SOURCES/java-1.8.0-openjdk-portable.specfile +++ b/SOURCES/java-1.8.0-openjdk-portable.specfile @@ -1,3 +1,86 @@ +# New Version-String scheme-style defines +%global majorver 8 +# Define version of OpenJDK 8 used +%global project openjdk +%global repo shenandoah-jdk8u +%global openjdk_revision 8u504-b01 +%global shenandoah_revision shenandoah%{openjdk_revision} +# e.g. aarch64-shenandoah-jdk8u212-b04-shenandoah-merge-2019-04-30 -> aarch64-shenandoah-jdk8u212-b04 +%global version_tag %(VERSION=%{shenandoah_revision}; echo ${VERSION%%-shenandoah-merge*}) +# eg # jdk8u60-b27 -> jdk8u60 or # aarch64-jdk8u60-b27 -> aarch64-jdk8u60 (dont forget spec escape % by %%) +%global whole_update %(VERSION=%{version_tag}; echo ${VERSION%%-*}) +# eg jdk8u60 -> 60 or aarch64-jdk8u60 -> 60 +%global updatever %(VERSION=%{whole_update}; echo ${VERSION##*u}) +# eg jdk8u60-b27 -> b27 +%global buildver %(VERSION=%{version_tag}; echo ${VERSION##*-}) +%global portablerelease 2 +%global rpmrelease 0 + +# Define IcedTea version used for SystemTap tapsets and desktop file +%global icedteaver 3.15.0 +# Define current Git revision for the FIPS support patches +%global fipsver 6d1aade0648 +# Define current Git revision for the cacerts patch +%global cacertsver 8139f2361c2 +%global javaver 1.%{majorver}.0 + +# Standard JPackage naming and versioning defines +%global origin openjdk +%global origin_nice OpenJDK +%global top_level_dir_name %{shenandoah_revision} + +# Define milestone (EA for pre-releases, GA ("fcs") for releases) +# Release will be (where N is usually a number starting at 1): +# - 0.N.ea for EA releases, +# - N for GA releases +%global is_ga 1 +%if %{is_ga} +%global milestone fcs +%global milestone_version %{nil} +%global extraver %{nil} +%global eaprefix %{nil} +%else +%global milestone ea +%global milestone_version "-ea" +%global extraver .%{milestone} +%global eaprefix 0. +%endif + +%global compatiblename java-%{javaver}-%{origin} + +Name: %{compatiblename}-portable%{?pkgos:-%{pkgos}} +Version: %{javaver}.%{updatever}.%{buildver} +Release: %{?eaprefix}%{portablerelease}.%{rpmrelease}%{?extraver}%{?dist} + +%global fullversion %{compatiblename}-%{version}-%{release} + +# java-1.5.0-ibm from jpackage.org set Epoch to 1 for unknown reasons +# and this change was brought into RHEL-4. java-1.5.0-ibm packages +# also included the epoch in their virtual provides. This created a +# situation where in-the-wild java-1.5.0-ibm packages provided "java = +# 1:1.5.0". In RPM terms, "1.6.0 < 1:1.5.0" since 1.6.0 is +# interpreted as 0:1.6.0. So the "java >= 1.6.0" requirement would be +# satisfied by the 1:1.5.0 packages. Thus we need to set the epoch in +# JDK package >= 1.6.0 to 1, and packages referring to JDK virtual +# provides >= 1.6.0 must specify the epoch, "java >= 1:1.6.0". + +Epoch: 1 +Summary: %{origin_nice} %{majorver} Runtime Environment portable edition +Group: Development/Languages + +# HotSpot code is licensed under GPLv2 +# JDK library code is licensed under GPLv2 with the Classpath exception +# The Apache license is used in code taken from Apache projects (primarily JAXP & JAXWS) +# DOM levels 2 & 3 and the XML digital signature schemas are licensed under the W3C Software License +# The JSR166 concurrency code is in the public domain +# The BSD and MIT licenses are used for a number of third-party libraries (see THIRD_PARTY_README) +# The OpenJDK source tree includes the JPEG library (IJG), zlib & libpng (zlib), giflib and LCMS (MIT) +# The test code includes copies of NSS under the Mozilla Public License v2.0 +# The PCSClite headers are under a BSD with advertising license +# The elliptic curve cryptography (ECC) source code is licensed under the LGPLv2.1 or any later version +License: ASL 1.1 and ASL 2.0 and BSD and BSD with advertising and GPL+ and GPLv2 and GPLv2 with exceptions and IJG and LGPLv2+ and MIT and MPLv2.0 and Public Domain and W3C and zlib +URL: http://openjdk.java.net/ + # RPM conditionals so as to be able to dynamically produce # slowdebug/release builds. See: # http://rpm.org/user_doc/conditional_builds.html @@ -83,6 +166,9 @@ # we need to distinguish between big and little endian PPC64 %global ppc64le ppc64le %global ppc64be ppc64 ppc64p7 + +# Define the architectures on which we build +ExclusiveArch: %{aarch64} %{ix86} %{ppc64le} s390x x86_64 # Set of architectures which support multiple ABIs %global multilib_arches %{power64} sparc64 x86_64 # Set of architectures for which we build slowdebug builds @@ -177,6 +263,10 @@ %endif %global bootjdk /usr/lib/jvm/java-%{buildjdkver}-openjdk +# Disable LTO as this causes build failures at the moment. +# See RHBZ#1861401 and https://bugs.gentoo.org/833097 +%define _lto_cflags %{nil} + # Filter out flags from the optflags macro that cause problems with the OpenJDK build # We filter out -O flags so that the optimization of HotSpot is not lowered from O3 to O2 # We filter out -Wall which will otherwise cause HotSpot to produce hundreds of thousands of warnings (100+mb logs) @@ -266,25 +356,6 @@ %global with_systemtap 0 %endif -# New Version-String scheme-style defines -%global majorver 8 -# Define version of OpenJDK 8 used -%global project openjdk -%global repo shenandoah-jdk8u -%global openjdk_revision 8u482-b08 -%global shenandoah_revision shenandoah%{openjdk_revision} -# Define IcedTea version used for SystemTap tapsets and desktop file -%global icedteaver 3.15.0 -# Define current Git revision for the FIPS support patches -%global fipsver 6d1aade0648 -# Define current Git revision for the cacerts patch -%global cacertsver 8139f2361c2 - -# Standard JPackage naming and versioning defines -%global origin openjdk -%global origin_nice OpenJDK -%global top_level_dir_name %{shenandoah_revision} - # Settings for local security configuration %global security_file %{top_level_dir_name}/jdk/src/share/lib/security/java.security-%{_target_os} %global cacerts_file /etc/pki/java/cacerts @@ -295,11 +366,11 @@ # Define what url should JVM offer in case of a crash report # order may be important, epel may have rhel declared %if 0%{?epel} -%global oj_vendor_bug_url https://bugzilla.redhat.com/enter_bug.cgi?product=Fedora%20EPEL&component=%{component}&version=epel%{epel} +%global oj_vendor_bug_url https://bugzilla.redhat.com/enter_bug.cgi?product=Fedora%20EPEL&component=%{compatiblename}&version=epel%{epel} %else %if 0%{?fedora} # Does not work for rawhide, keeps the version field empty -%global oj_vendor_bug_url https://bugzilla.redhat.com/enter_bug.cgi?product=Fedora&component=%{component}&version=%{fedora} +%global oj_vendor_bug_url https://bugzilla.redhat.com/enter_bug.cgi?product=Fedora&component=%{compatiblename}&version=%{fedora} %else %if 0%{?rhel} %global oj_vendor_bug_url https://access.redhat.com/support/cases/ @@ -309,39 +380,6 @@ %endif %endif -# e.g. aarch64-shenandoah-jdk8u212-b04-shenandoah-merge-2019-04-30 -> aarch64-shenandoah-jdk8u212-b04 -%global version_tag %(VERSION=%{shenandoah_revision}; echo ${VERSION%%-shenandoah-merge*}) -# eg # jdk8u60-b27 -> jdk8u60 or # aarch64-jdk8u60-b27 -> aarch64-jdk8u60 (dont forget spec escape % by %%) -%global whole_update %(VERSION=%{version_tag}; echo ${VERSION%%-*}) -# eg jdk8u60 -> 60 or aarch64-jdk8u60 -> 60 -%global updatever %(VERSION=%{whole_update}; echo ${VERSION##*u}) -# eg jdk8u60-b27 -> b27 -%global buildver %(VERSION=%{version_tag}; echo ${VERSION##*-}) -%global rpmrelease 1 -# Define milestone (EA for pre-releases, GA ("fcs") for releases) -# Release will be (where N is usually a number starting at 1): -# - 0.N%%{?extraver}%%{?dist} for EA releases, -# - N%%{?extraver}{?dist} for GA releases -%global is_ga 1 -%if %{is_ga} -%global milestone fcs -%global milestone_version %{nil} -%global extraver %{nil} -%global eaprefix %{nil} -%else -%global milestone ea -%global milestone_version "-ea" -%global extraver .%{milestone} -%global eaprefix 0. -%endif -# priority must be 7 digits in total. The expression is workarounding tip -%global priority %(TIP=1800%{updatever}; echo ${TIP/tip/999}) - -%global javaver 1.%{majorver}.0 - -# parametrized macros are order-sensitive -%global compatiblename %{name} -%global fullversion %{compatiblename}-%{version}-%{release} # images stub %global jdkimage j2sdk-image %global jreimage j2re-image @@ -353,91 +391,34 @@ %define uniquejavadocdir() %{expand:%{fullversion}%{?1}} # main id and dir of this jdk %define uniquesuffix() %{expand:%{fullversion}.%{_arch}%{?1}} -%define jreportablenameimpl() %(echo %{uniquesuffix ""} | sed "s;el%{rhel}\\(_[0-9]\\)*;portable%{1}.jre;g") -%define jdkportablenameimpl() %(echo %{uniquesuffix ""} | sed "s;el%{rhel}\\(_[0-9]\\)*;portable%{1}.jdk;g") +%define jreportablenameimpl() %(echo %{uniquesuffix ""} | sed "s;el%{rhel}[^.]*;portable%{1}.jre;g") +%define jdkportablenameimpl() %(echo %{uniquesuffix ""} | sed "s;el%{rhel}[^.]*;portable%{1}.jdk;g") +# RPM 4.19 no longer accept our double percentaged %%{nil} passed to %%{1} +# so we have to pass in "" but evaluate it, otherwise files will include it %define jreportablearchive() %{expand:%{jreportablenameimpl -- %%{1}}.tar.xz} +%define jreportablearchive_for_files() %(echo %{jreportablearchive -- ""}) %define jdkportablearchive() %{expand:%{jdkportablenameimpl -- %%{1}}.tar.xz} +%define jdkportablearchive_for_files() %(echo %{jdkportablearchive -- ""}) %define jreportablename() %{expand:%{jreportablenameimpl -- %%{1}}} %define jdkportablename() %{expand:%{jdkportablenameimpl -- %%{1}}} -%define docportablename() %(echo %{uniquesuffix ""} | sed "s;el%{rhel}\\(_[0-9]\\)*;portable.docs;g") +%define docportablename() %(echo %{uniquesuffix ""} | sed "s;el%{rhel}[^.]*;portable.docs;g") %define docportablearchive() %{docportablename}.tar.xz -%define miscportablename() %(echo %{uniquesuffix ""} | sed "s;el%{rhel}\\(_[0-9]\\)*;portable.misc;g") +%define miscportablename() %(echo %{uniquesuffix ""} | sed "s;el%{rhel}[^.]*;portable.misc;g") %define miscportablearchive() %{miscportablename}.tar.xz -# Fix for https://bugzilla.redhat.com/show_bug.cgi?id=1111349. -# See also https://bugzilla.redhat.com/show_bug.cgi?id=1590796 -# as to why some libraries *cannot* be excluded. In particular, -# these are: -# libjsig.so, libjava.so, libjawt.so, libjvm.so and libverify.so -%global _privatelibs libatk-wrapper[.]so.*|libattach[.]so.*|libawt_headless[.]so.*|libawt[.]so.*|libawt_xawt[.]so.*|libdt_socket[.]so.*|libfontmanager[.]so.*%{freetype_lib}|libhprof[.]so.*|libinstrument[.]so.*|libj2gss[.]so.*|libj2pcsc[.]so.*|libj2pkcs11[.]so.*|libjaas_unix[.]so.*|libjava_crw_demo[.]so.*%{jpeg_lib}|libjdwp[.]so.*|libjli[.]so.*|libjsdt[.]so.*|libjsoundalsa[.]so.*|libjsound[.]so.*|liblcms[.]so.*|libmanagement[.]so.*|libmlib_image[.]so.*|libnet[.]so.*|libnio[.]so.*|libnpt[.]so.*|libsaproc[.]so.*|libsctp[.]so.*|libsplashscreen[.]so.*|libsunec[.]so.*|libsystemconf[.]so.*|libunpack[.]so.*|libzip[.]so.*|lib[.]so\\(SUNWprivate_.* -%global __provides_exclude ^(%{_privatelibs})$ -%global __requires_exclude ^(%{_privatelibs})$ - -# Standard JPackage directories and symbolic links. -%global sdkdir() %{expand:%{uniquesuffix %%1}} -%global jrelnk() %{expand:jre-%{javaver}-%{origin}-%{version}-%{release}.%{_arch}%1} - -%global jredir() %{expand:%{sdkdir %%1}/jre} -%global sdkbindir() %{expand:%{_jvmdir}/%{sdkdir %%1}/bin} -%global jrebindir() %{expand:%{_jvmdir}/%{jredir %%1}/bin} %global alt_java_name alt-java -%global jvmjardir() %{expand:%{_jvmjardir}/%{uniquesuffix %%1}} - -%global rpm_state_dir %{_localstatedir}/lib/rpm-state/ - -# For flatpack builds hard-code /usr/sbin/alternatives, -# otherwise use %%{_sbindir} relative path. -%if 0%{?flatpak} -%global alternatives_requires /usr/sbin/alternatives -%else -%global alternatives_requires %{_sbindir}/alternatives -%endif # Prevent brp-java-repack-jars from being run. %global __jar_repack 0 -# portables have grown out of its component, moving back to java-x-vendor -# this expression, when declared as global, filled component with java-x-vendor portable -%define component %(echo %{name} | sed "s;-portable;;g") - -Name: java-%{javaver}-%{origin}-portable -Version: %{javaver}.%{updatever}.%{buildver} -Release: %{?eaprefix}%{rpmrelease}%{?extraver}%{?dist} -# java-1.5.0-ibm from jpackage.org set Epoch to 1 for unknown reasons -# and this change was brought into RHEL-4. java-1.5.0-ibm packages -# also included the epoch in their virtual provides. This created a -# situation where in-the-wild java-1.5.0-ibm packages provided "java = -# 1:1.5.0". In RPM terms, "1.6.0 < 1:1.5.0" since 1.6.0 is -# interpreted as 0:1.6.0. So the "java >= 1.6.0" requirement would be -# satisfied by the 1:1.5.0 packages. Thus we need to set the epoch in -# JDK package >= 1.6.0 to 1, and packages referring to JDK virtual -# provides >= 1.6.0 must specify the epoch, "java >= 1:1.6.0". - -Epoch: 1 -Summary: %{origin_nice} %{majorver} Runtime Environment portable edition -Group: Development/Languages - -# HotSpot code is licensed under GPLv2 -# JDK library code is licensed under GPLv2 with the Classpath exception -# The Apache license is used in code taken from Apache projects (primarily JAXP & JAXWS) -# DOM levels 2 & 3 and the XML digital signature schemas are licensed under the W3C Software License -# The JSR166 concurrency code is in the public domain -# The BSD and MIT licenses are used for a number of third-party libraries (see THIRD_PARTY_README) -# The OpenJDK source tree includes the JPEG library (IJG), zlib & libpng (zlib), giflib and LCMS (MIT) -# The test code includes copies of NSS under the Mozilla Public License v2.0 -# The PCSClite headers are under a BSD with advertising license -# The elliptic curve cryptography (ECC) source code is licensed under the LGPLv2.1 or any later version -License: ASL 1.1 and ASL 2.0 and BSD and BSD with advertising and GPL+ and GPLv2 and GPLv2 with exceptions and IJG and LGPLv2+ and MIT and MPLv2.0 and Public Domain and W3C and zlib -URL: http://openjdk.java.net/ - # Shenandoah HotSpot # openjdk/shenandoah-jdk8u contains an integration forest of # OpenJDK 8u and the Shenandoah garbage collector # To regenerate, use: -# VERSION=%%{shenandoah_revision} +# VERSION= # FILE_NAME_ROOT=${VERSION} # REPO_ROOT= generate_source_tarball.sh -# where the source is obtained from http://github.com/%%{project}/%%{repo} +# where the source is obtained from http://github.com// Source0: %{shenandoah_revision}.tar.xz # Custom README for -src subpackage @@ -501,11 +482,14 @@ Patch534: rh1648246-always_instruct_vm_to_assume_multiple_processors_are_availab Patch1000: rh1648249-add_commented_out_nss_cfg_provider_to_java_security.patch # RH1582504: Use RSA as default for keytool, as DSA is disabled in all crypto policies except LEGACY Patch1003: rh1582504-rsa_default_for_keytool.patch +# RH1750419: Enable build of speculative store bypass hardened alt-java (CVE-2018-3639) +Patch600: rh1750419-redhat_alt_java.patch # Crypto policy and FIPS support patches # Patch is generated from the fips tree at https://github.com/rh-openjdk/jdk8u/tree/fips -# as follows: git diff %%{openjdk_revision} common jdk > fips-8u-$(git show -s --format=%h HEAD).patch +# as follows: git diff common jdk > fips-8u-$(git show -s --format=%h HEAD).patch # Diff is limited to src and make subdirectories to exclude .github changes + # Fixes currently included: # PR3183, RH1340845: Support Fedora/RHEL8 system crypto policy # PR3655: Allow use of system crypto policy to be disabled by the user @@ -547,8 +531,8 @@ Patch528: pr3083-rh1346460-for_ssl_debug_return_null_instead_of_exception_when_t # as follows: git diff fips > pr2888-rh2055274-support_system_cacerts-$(git show -s --format=%h HEAD).patch Patch539: pr2888-rh2055274-support_system_cacerts-%{cacertsver}.patch Patch541: rh1684077-openjdk_should_depend_on_pcsc-lite-libs_instead_of_pcsc-lite-devel.patch -# RH1750419: Enable build of speculative store bypass hardened alt-java (CVE-2018-3639) -Patch600: rh1750419-redhat_alt_java.patch +# JDK-8385876: [8u] hotspot/src/share/vm/code/compiledIC.cpp:406:30: error: 'this' pointer is null +Patch542: jdk8385876-zero_this_pointer_is_null.patch ############################################# # @@ -595,8 +579,6 @@ Patch204: jdk8042159-allow_using_system_installed_lcms2-jdk.patch Patch581: jdk8257794-remove_broken_assert.patch # JDK-8186464, RH1433262: ZipFile cannot read some InfoZip ZIP64 zip files Patch12: jdk8186464-rh1433262-zip64_failure.patch -# JDK-8328999, RH2251025 - Update GIFlib to 5.2.2 (PR#571) -Patch13: jdk8328999-update_giflib_5.2.2.patch # JDK-8141590 - Cannot build Zero with devkit Patch14: jdk8141590-bundle_libffi.patch Patch15: jdk8141590-bundle_libffi-followup.patch @@ -697,17 +679,17 @@ BuildRequires: libpng-devel BuildRequires: zlib-devel %else # Version in jdk/src/share/native/sun/awt/libfreetype/include/freetype/freetype.h -Provides: bundled(freetype) = 2.13.3 +Provides: bundled(freetype) = 2.14.3 # Version in jdk/src/share/native/sun/awt/giflib/gif_lib.h -Provides: bundled(giflib) = 5.2.2 +Provides: bundled(giflib) = 6.1.2 # Version in jdk/src/share/native/sun/java2d/cmm/lcms/lcms2.h -Provides: bundled(lcms2) = 2.14.0 +Provides: bundled(lcms2) = 2.19.1 # Version in jdk/src/share/native/sun/awt/image/jpeg/jpeglib.h Provides: bundled(libjpeg) = 6b # Version in jdk/src/share/native/sun/awt/libpng/png.h -Provides: bundled(libpng) = 1.6.51 +Provides: bundled(libpng) = 1.6.57 # Version in jdk/src/share/native/java/util/zip/zlib/zlib.h -Provides: bundled(zlib) = 1.3.1 +Provides: bundled(zlib) = 1.3.2 # We link statically against libstdc++ to increase portability BuildRequires: libstdc++-static %endif @@ -807,11 +789,7 @@ export XZ_OPT="-T0" %endif %setup -q -c -n %{uniquesuffix ""} -T -a 0 # https://bugzilla.redhat.com/show_bug.cgi?id=1189084 -prioritylength=`expr length %{priority}` -if [ $prioritylength -ne 7 ] ; then - echo "priority must be 7 digits in total, violated" - exit 14 -fi + # For old patches ln -s %{top_level_dir_name} jdk8 ln -s %{top_level_dir_name} openjdk @@ -827,20 +805,6 @@ cp %{SOURCE101} %{top_level_dir_name}/common/autoconf/build-aux/ # OpenJDK patches -# This syntax is deprecated: -# %patchN [...] -# and should be replaced with: -# %patch -PN [...] -# For example: -# %patch1001 -p1 -# becomes: -# %patch -P1001 -p1 -# The replacement format suggested by recent (circa Fedora 38) RPM -# deprecation messages: -# %patch N [...] -# is not backward-compatible with prior (circa RHEL-8) versions of -# rpmbuild. - %if %{system_libs} # Remove libraries that are linked sh %{SOURCE12} @@ -878,12 +842,12 @@ popd %patch -P574 %patch -P581 %patch -P541 -%patch -P12 pushd %{top_level_dir_name} +%patch -P12 -p1 %patch -P502 -p1 -%patch -P13 -p1 %patch -P14 -p1 %patch -P15 -p1 +%patch -P542 -p1 popd # Early fixes @@ -952,7 +916,6 @@ sed -e "s:@NSS_LIBDIR@:%{NSS_LIBDIR}:g" %{SOURCE17} > nss.fips.cfg export NUM_PROC=%(/usr/bin/getconf _NPROCESSORS_ONLN 2> /dev/null || :) export NUM_PROC=${NUM_PROC:-1} %if 0%{?_smp_ncpus_max} -# Honor %%_smp_ncpus_max [ ${NUM_PROC} -gt %{?_smp_ncpus_max} ] && export NUM_PROC=%{?_smp_ncpus_max} %endif %ifnarch %{ix86} @@ -962,21 +925,33 @@ export XZ_OPT="-T0" %ifarch s390x sparc64 alpha %{power64} %{aarch64} export ARCH_DATA_MODEL=64 %endif -%ifarch alpha -export CFLAGS="$CFLAGS -mieee" -%endif -# We use ourcppflags because the OpenJDK build seems to -# pass EXTRA_CFLAGS to the HotSpot C++ compiler... +# HotSpot uses EXTRA_CPP_FLAGS since JDK-8374917 in 8u492-b01 EXTRA_CFLAGS="%ourcppflags -Wno-error" EXTRA_CPP_FLAGS="%ourcppflags" + +%ifarch alpha +export EXTRA_CPP_FLAGS="$CFLAGS -mieee" +%endif + %ifarch %{power64} ppc EXTRA_CFLAGS="$EXTRA_CFLAGS -fno-tree-vectorize" # fix rpmlint warnings EXTRA_CFLAGS="$EXTRA_CFLAGS -fno-strict-aliasing" +# Workaround -Wnonnull warnings (OPENJDK-4894) +EXTRA_CPP_FLAGS="$EXTRA_CPP_FLAGS -Wno-nonnull" %endif + +%ifnarch %{zero_arches} +# -Wstringop-overflow is not supported on RHEL 7's gcc +%if 0%{?rhel} != 7 +EXTRA_CPP_FLAGS="$EXTRA_CPP_FLAGS -Wno-error=stringop-overflow" +%endif +%endif + EXTRA_ASFLAGS="${EXTRA_CFLAGS} -Wa,--generate-missing-build-notes=yes" -export EXTRA_CFLAGS EXTRA_ASFLAGS + +export EXTRA_CFLAGS EXTRA_CPP_FLAGS EXTRA_ASFLAGS function buildjdk() { local outputdir=${1} @@ -1504,9 +1479,9 @@ done %files # main package builds always -%{_jvmdir}/%{jreportablearchive -- %%{nil}} +%{_jvmdir}/%{jreportablearchive_for_files} %{_jvmdir}/%{jreportablearchive -- .debuginfo} -%{_jvmdir}/%{jreportablearchive -- %%{nil}}.sha256sum +%{_jvmdir}/%{jreportablearchive_for_files}.sha256sum %{_jvmdir}/%{jreportablearchive -- .debuginfo}.sha256sum %else @@ -1519,9 +1494,9 @@ done %if %{include_normal_build} %files devel -%{_jvmdir}/%{jdkportablearchive -- %%{nil}} +%{_jvmdir}/%{jdkportablearchive_for_files} %{_jvmdir}/%{jdkportablearchive -- .debuginfo} -%{_jvmdir}/%{jdkportablearchive -- %%{nil}}.sha256sum +%{_jvmdir}/%{jdkportablearchive_for_files}.sha256sum %{_jvmdir}/%{jdkportablearchive -- .debuginfo}.sha256sum %files unstripped @@ -1563,6 +1538,81 @@ done %endif %changelog +* Wed Aug 12 15:48:31 BST 2026 Andrew Hughes - 1:1.8.0.504.b01-2.0 +- Add CVEs for August 2026 release +- ** This tarball is embargoed until 2026-08-18 @ 1pm PT. ** +- Related: OPENJDK-5034 + +* Mon Aug 10 2026 Andrew Hughes - 1:1.8.0.504.b01-1.0 +- Update to 8u504-b01 (GA). +- Update release notes for 8u504-b01. +- Bump FreeType version to 2.14.3 following JDK-8385390 +- ** This tarball is embargoed until 2026-08-18 @ 1pm PT. ** +- Resolves: OPENJDK-5034 + +* Mon Jul 27 2026 Andrew Hughes - 1:1.8.0.502.b07-2.0 +- Add CVEs to NEWS file +- Related: OPENJDK-4869 + +* Fri Jul 17 2026 Andrea Bolognani - 1:1.8.0.502.b07-1.0 +- Strip %%{dist} more thoroughly +- Resolves: OPENJDK-4907 + +* Thu Jul 16 2026 Andrew Hughes - 1:1.8.0.502.b07-1.0 +- Update to 8u502-b07 (GA). +- Update release notes for 8u502-b07. +- Bump lcms2 version to 2.19.1 following JDK-8321489, JDK-8348110, JDK-8375065 & JDK-8383354 +- Bump zlib version to 1.3.2 following JDK-8378631 +- Port ForFiles patch to RHEL and update to use standard function naming format +- Remove macro references in comments where possible (%dnl not compatible enough yet) +- Cleanup RPM only macros unused in the portable spec file +- Move version information and core NVR definitions back towards the top of the file +- Explictly define supported architectures +- Specify portablerelease and rpmrelease (always 0 for portables) in the Release field +- Make zone string debug output optional in TestTranslations +- Add RHEL 7 opt-out on -Werror=stringop-overflow which is unsupported on its gcc +- ** This tarball is embargoed until 2026-07-21 @ 1pm PT. ** +- Resolves: OPENJDK-4869 +- Related: OPENJDK-4896 +- Resolves: OPENJDK-4903 +- Resolves: OPENJDK-4904 +- Resolves: OPENJDK-4906 +- Resolves: OPENJDK-4908 +- Related: OPENJDK-4895 + +* Wed Jul 15 2026 Jiri Vanek - 1:1.8.0.502.b07-1.0 +- Redeclared ForFiles release sections as %%nil no longer works with %%1 +- RPM 4.19 no longer accept our double percentaged %%{nil} passed to %%{1} +- so we have to pass in "" but evaluate it, otherwise files record will include it +- Resolves: OPENJDK-4896 + +* Wed Jul 15 2026 Andrew Hughes - 1:1.8.0.492.b09-2 +- Add attempted patch for JDK-8385876 to fix -Wnonnull build failure with s390x Zero on CentOS 9 +- Workaround -Wnonull failure with ppc64le on CentOS 9 using -Wno-nonnull +- Workaround -Werror=stringop-overflow failure with JIT debug builds on CentOS 9 using -Wno-error=stringop-overflow +- Resolves: OPENJDK-4893 +- Resolves: OPENJDK-4894 +- Resolves: OPENJDK-4895 + +* Fri Apr 17 2026 Andrew Hughes - 1:1.8.0.492.b09-1 +- Update to 8u492-b09 (GA) +- Update release notes for 8u492-b09. +- Regenerate JDK-8199936/PR3533 patch following JDK-8374917 +- Regenerate JDK-8186464/RH1433262 patch following JDK-8370986 +- Drop local giflib 5.2.2 patch now JDK-8328999 is included upstream +- Bump freetype version to 2.14.2 following JDK-8373290 & JDK-8379158 +- Bump giflib version to 6.1.2 following JDK-8379256 & JDK-8380078 +- Bump LCMS 2 version to 2.15.0 following JDK-8303482 +- Bump libpng version to 1.6.57 following JDK-8375063, JDK-8377526, JDK-8380959 & JDK-8382047 +- ** This tarball is embargoed until 2026-04-21 @ 1pm PT. ** +- Resolves: OPENJDK-4601 +- Resolves: OPENJDK-4294 +- Resolves: OPENJDK-4518 +- Resolves: OPENJDK-4538 +- Resolves: OPENJDK-4547 +- Resolves: OPENJDK-4613 +- Resolves: OPENJDK-4635 + * Mon Jan 19 2026 Andrew Hughes - 1:1.8.0.482.b08-1 - Update to 8u482-b08 (GA). - Update release notes for 8u482-b08. @@ -1790,6 +1840,7 @@ done - Regenerate PR2462 patch following JDK-8315135 - Bump version of bundled libpng to 1.6.39 - Add backport of JDK-8312489 heading upstream for 8u402 (see OPENJDK-2095) +- Workaround undefined symbol: _ZN16G1TriggerClosure9do_oop_nvIjEEvPT_ by disabling LTO - ** This tarball is embargoed until 2023-10-17 @ 1pm PT. ** * Fri Sep 29 2023 Andrew Hughes - 1:1.8.0.392.b01-1 diff --git a/SOURCES/jdk8186464-rh1433262-zip64_failure.patch b/SOURCES/jdk8186464-rh1433262-zip64_failure.patch index 572a36e..2528d53 100644 --- a/SOURCES/jdk8186464-rh1433262-zip64_failure.patch +++ b/SOURCES/jdk8186464-rh1433262-zip64_failure.patch @@ -7,10 +7,10 @@ 8186464: ZipFile cannot read some InfoZip ZIP64 zip files Reviewed-by: martin -diff --git openjdk.orig/jdk/src/share/demo/nio/zipfs/src/com/sun/nio/zipfs/ZipFileSystem.java openjdk/jdk/src/share/demo/nio/zipfs/src/com/sun/nio/zipfs/ZipFileSystem.java -index 26e2a5bf9e9..2630c118817 100644 ---- openjdk.orig/jdk/src/share/demo/nio/zipfs/src/com/sun/nio/zipfs/ZipFileSystem.java -+++ openjdk/jdk/src/share/demo/nio/zipfs/src/com/sun/nio/zipfs/ZipFileSystem.java +diff --git a/jdk/src/share/demo/nio/zipfs/src/com/sun/nio/zipfs/ZipFileSystem.java b/jdk/src/share/demo/nio/zipfs/src/com/sun/nio/zipfs/ZipFileSystem.java +index d3c68e5e06..fd249461e8 100644 +--- a/jdk/src/share/demo/nio/zipfs/src/com/sun/nio/zipfs/ZipFileSystem.java ++++ b/jdk/src/share/demo/nio/zipfs/src/com/sun/nio/zipfs/ZipFileSystem.java @@ -92,6 +92,7 @@ public class ZipFileSystem extends FileSystem { private final boolean createNew; // create a new zip if not exists private static final boolean isWindows = @@ -132,16 +132,16 @@ index 26e2a5bf9e9..2630c118817 100644 writeLong(os, cenlen); // length of central directory writeLong(os, cenoff); // offset of central directory -diff --git openjdk.orig/jdk/src/share/native/java/util/zip/zip_util.c openjdk/jdk/src/share/native/java/util/zip/zip_util.c -index 5fd6fea049d..858e5814e92 100644 ---- openjdk.orig/jdk/src/share/native/java/util/zip/zip_util.c -+++ openjdk/jdk/src/share/native/java/util/zip/zip_util.c +diff --git a/jdk/src/share/native/java/util/zip/zip_util.c b/jdk/src/share/native/java/util/zip/zip_util.c +index a5f164f750..30596d5baf 100644 +--- a/jdk/src/share/native/java/util/zip/zip_util.c ++++ b/jdk/src/share/native/java/util/zip/zip_util.c @@ -385,6 +385,9 @@ findEND64(jzfile *zip, void *end64buf, jlong endpos) { char loc64[ZIP64_LOCHDR]; jlong end64pos; + if (endpos < ZIP64_LOCHDR) { -+ return -1; ++ return -1; + } if (readFullyAt(zip->zfd, loc64, ZIP64_LOCHDR, endpos - ZIP64_LOCHDR) == -1) { return -1; // end64 locator not found @@ -149,7 +149,7 @@ index 5fd6fea049d..858e5814e92 100644 @@ -567,6 +570,7 @@ readCEN(jzfile *zip, jint knownTotal) { /* Following are unsigned 32-bit */ - jlong endpos, end64pos, cenpos, cenlen, cenoff; + jlong endpos, end64pos, cenpos, cenlen, cenoff, total64; + jlong cenlen64, cenoff64, centot64; /* Following are unsigned 16-bit */ jint total, tablelen, i, j; @@ -164,28 +164,28 @@ index 5fd6fea049d..858e5814e92 100644 - if ((end64pos = findEND64(zip, end64buf, endpos)) != -1) { - cenlen = ZIP64_ENDSIZ(end64buf); - cenoff = ZIP64_ENDOFF(end64buf); -- total = (jint)ZIP64_ENDTOT(end64buf); +- total64 = ZIP64_ENDTOT(end64buf); + unsigned char end64buf[ZIP64_ENDHDR]; + if ((end64pos = findEND64(zip, end64buf, endpos)) != -1) { -+ // end64 candidate found, -+ cenlen64 = ZIP64_ENDSIZ(end64buf); -+ cenoff64 = ZIP64_ENDOFF(end64buf); -+ centot64 = ZIP64_ENDTOT(end64buf); -+ // double-check -+ if ((cenlen64 == cenlen || cenlen == ZIP64_MAGICVAL) && -+ (cenoff64 == cenoff || cenoff == ZIP64_MAGICVAL) && -+ (centot64 == total || total == ZIP64_MAGICCOUNT)) { -+ // to use the end64 values ++ // end64 candidate found, ++ cenlen64 = ZIP64_ENDSIZ(end64buf); ++ cenoff64 = ZIP64_ENDOFF(end64buf); ++ centot64 = ZIP64_ENDTOT(end64buf); ++ // double-check ++ if ((cenlen64 == cenlen || cenlen == ZIP64_MAGICVAL) && ++ (cenoff64 == cenoff || cenoff == ZIP64_MAGICVAL) && ++ (centot64 == total || total == ZIP64_MAGICCOUNT)) { ++ // to use the end64 values + cenlen = cenlen64; + cenoff = cenoff64; -+ total = (jint)centot64; - endpos = end64pos; - endhdrlen = ZIP64_ENDHDR; - } -diff --git openjdk.orig/jdk/test/java/util/zip/ZipFile/ReadZip.java openjdk/jdk/test/java/util/zip/ZipFile/ReadZip.java -index ffe8a8ed712..9b380003893 100644 ---- openjdk.orig/jdk/test/java/util/zip/ZipFile/ReadZip.java -+++ openjdk/jdk/test/java/util/zip/ZipFile/ReadZip.java ++ total64 = centot64; + /* ZIP64 size, offset and total-count fields are unsigned 64-bit + * values. Sizes and offsets that do not fit in signed jlong + * (i.e., >= 2^63), or total values that do not fit in jint, are +diff --git a/jdk/test/java/util/zip/ZipFile/ReadZip.java b/jdk/test/java/util/zip/ZipFile/ReadZip.java +index ffe8a8ed71..9b38000389 100644 +--- a/jdk/test/java/util/zip/ZipFile/ReadZip.java ++++ b/jdk/test/java/util/zip/ZipFile/ReadZip.java @@ -22,7 +22,7 @@ */ diff --git a/SOURCES/jdk8199936-pr3533-enable_mstackrealign_on_x86_linux_as_well_as_x86_mac_os_x.patch b/SOURCES/jdk8199936-pr3533-enable_mstackrealign_on_x86_linux_as_well_as_x86_mac_os_x.patch index aeef65a..647d14a 100644 --- a/SOURCES/jdk8199936-pr3533-enable_mstackrealign_on_x86_linux_as_well_as_x86_mac_os_x.patch +++ b/SOURCES/jdk8199936-pr3533-enable_mstackrealign_on_x86_linux_as_well_as_x86_mac_os_x.patch @@ -8,10 +8,10 @@ PR3533: HotSpot generates code with unaligned stack, crashes on SSE operations Summary: Enable -mstackrealign on x86 Linux as well as x86 Mac OS X diff --git a/common/autoconf/flags.m4 b/common/autoconf/flags.m4 -index 113bf367e2..bed030e8d1 100644 +index 5d1ef8732f..3394c2030a 100644 --- a/common/autoconf/flags.m4 +++ b/common/autoconf/flags.m4 -@@ -451,6 +451,21 @@ AC_DEFUN_ONCE([FLAGS_SETUP_COMPILER_FLAGS_FOR_JDK], +@@ -421,6 +421,21 @@ AC_DEFUN_ONCE([FLAGS_SETUP_COMPILER_FLAGS_FOR_JDK], AC_SUBST($2CXXSTD_CXXFLAG) fi @@ -34,35 +34,22 @@ index 113bf367e2..bed030e8d1 100644 AC_MSG_WARN([Ignoring CFLAGS($CFLAGS) found in environment. Use --with-extra-cflags]) fi diff --git a/common/autoconf/hotspot-spec.gmk.in b/common/autoconf/hotspot-spec.gmk.in -index 3f86751d2b..f8a271383f 100644 +index 449788025f..907ea8ed0c 100644 --- a/common/autoconf/hotspot-spec.gmk.in +++ b/common/autoconf/hotspot-spec.gmk.in -@@ -114,13 +114,14 @@ RC:=@HOTSPOT_RC@ - # Retain EXTRA_{CFLAGS,CXXFLAGS,LDFLAGS,ASFLAGS} for the target flags to - # maintain compatibility with the existing Makefiles - EXTRA_CFLAGS=@LEGACY_TARGET_CFLAGS@ $(NO_DELETE_NULL_POINTER_CHECKS_CFLAG) \ -- $(NO_LIFETIME_DSE_CFLAG) $(CXXSTD_CXXFLAG) -+ $(NO_LIFETIME_DSE_CFLAG) $(CXXSTD_CXXFLAG) \ -+ $(REALIGN_CFLAG) - EXTRA_CXXFLAGS=@LEGACY_TARGET_CXXFLAGS@ - EXTRA_LDFLAGS=@LEGACY_TARGET_LDFLAGS@ - EXTRA_ASFLAGS=@LEGACY_TARGET_ASFLAGS@ - # Define an equivalent set for the host flags (i.e. without sysroot options) - HOST_CFLAGS=@LEGACY_HOST_CFLAGS@ $(NO_DELETE_NULL_POINTER_CHECKS_CFLAG) \ -- $(NO_LIFETIME_DSE_CFLAG) $(CXXSTD_CXXFLAG) -+ $(NO_LIFETIME_DSE_CFLAG) $(CXXSTD_CXXFLAG) - HOST_CXXFLAGS=@LEGACY_HOST_CXXFLAGS@ - HOST_LDFLAGS=@LEGACY_HOST_LDFLAGS@ - HOST_ASFLAGS=@LEGACY_HOST_ASFLAGS@ -diff --git a/common/autoconf/spec.gmk.in b/common/autoconf/spec.gmk.in -index 9573bb2cbd..fe7efc130c 100644 ---- a/common/autoconf/spec.gmk.in -+++ b/common/autoconf/spec.gmk.in -@@ -366,6 +366,7 @@ CXXFLAGS_JDKEXE:=@CXXFLAGS_JDKEXE@ +@@ -113,12 +113,14 @@ RC:=@HOTSPOT_RC@ NO_DELETE_NULL_POINTER_CHECKS_CFLAG=@NO_DELETE_NULL_POINTER_CHECKS_CFLAG@ NO_LIFETIME_DSE_CFLAG=@NO_LIFETIME_DSE_CFLAG@ +REALIGN_CFLAG=@REALIGN_CFLAG@ CXXSTD_CXXFLAG=@CXXSTD_CXXFLAG@ - CXX:=@FIXPATH@ @CCACHE@ @CXX@ + # Retain EXTRA_{CFLAGS,CXXFLAGS,LDFLAGS,ASFLAGS} for the target flags to + # maintain compatibility with the existing Makefiles + EXTRA_CXXFLAGS=@LEGACY_TARGET_CXXFLAGS@ $(NO_DELETE_NULL_POINTER_CHECKS_CFLAG) \ +- $(NO_LIFETIME_DSE_CFLAG) $(CXXSTD_CXXFLAG) ++ $(NO_LIFETIME_DSE_CFLAG) $(CXXSTD_CXXFLAG) \ ++ $(REALIGN_CFLAG) + EXTRA_CFLAGS=@LEGACY_TARGET_CFLAGS@ + EXTRA_LDFLAGS=@LEGACY_TARGET_LDFLAGS@ + EXTRA_ASFLAGS=@LEGACY_TARGET_ASFLAGS@ diff --git a/SOURCES/jdk8328999-update_giflib_5.2.2.patch b/SOURCES/jdk8328999-update_giflib_5.2.2.patch deleted file mode 100644 index e9eb0de..0000000 --- a/SOURCES/jdk8328999-update_giflib_5.2.2.patch +++ /dev/null @@ -1,2596 +0,0 @@ -diff --git a/THIRD_PARTY_README b/THIRD_PARTY_README -index f9aea78d64..605b36f100 100644 ---- a/THIRD_PARTY_README -+++ b/THIRD_PARTY_README -@@ -1696,7 +1696,7 @@ released under other open source licenses. - - ------------------------------------------------------------------------------- - --%% This notice is provided with respect to GIFLIB 5.2.1 & libungif 4.1.3, -+%% This notice is provided with respect to GIFLIB 5.2.2 & libungif 4.1.3, - which may be included with JRE 8, JDK 8, and OpenJDK 8. - - --- begin of LICENSE --- -@@ -1721,6 +1721,29 @@ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - THE SOFTWARE. - -+tree/README -+ -+== Authors == -+ -+Gershon Elber -+original giflib code -+ -+Toshio Kuratomi -+uncompressed gif writing code -+former maintainer -+ -+Eric Raymond -+current as well as long time former maintainer of giflib code -+ -+There have been many other contributors; see the attributions in the -+version-control history to learn more. -+ -+ -+tree/openbsd-reallocarray.c -+ -+Copyright (C) 2008 Otto Moerbeek -+SPDX-License-Identifier: MIT -+ - --- end of LICENSE --- - - ------------------------------------------------------------------------------- -diff --git a/jdk/src/share/native/sun/awt/giflib/dgif_lib.c b/jdk/src/share/native/sun/awt/giflib/dgif_lib.c -index 6ddfb46060..0b2860b4b5 100644 ---- a/jdk/src/share/native/sun/awt/giflib/dgif_lib.c -+++ b/jdk/src/share/native/sun/awt/giflib/dgif_lib.c -@@ -34,11 +34,11 @@ SPDX-License-Identifier: MIT - - *****************************************************************************/ - --#include -+#include - #include - #include --#include - #include -+#include - #include - - #ifdef _WIN32 -@@ -55,18 +55,19 @@ SPDX-License-Identifier: MIT - - /* avoid extra function call in case we use fread (TVT) */ - static int InternalRead(GifFileType *gif, GifByteType *buf, int len) { -- //fprintf(stderr, "### Read: %d\n", len); -- return -- (((GifFilePrivateType*)gif->Private)->Read ? -- ((GifFilePrivateType*)gif->Private)->Read(gif,buf,len) : -- fread(buf,1,len,((GifFilePrivateType*)gif->Private)->File)); -+ // fprintf(stderr, "### Read: %d\n", len); -+ return (((GifFilePrivateType *)gif->Private)->Read -+ ? ((GifFilePrivateType *)gif->Private)->Read(gif, buf, len) -+ : fread(buf, 1, len, -+ ((GifFilePrivateType *)gif->Private)->File)); - } - - static int DGifGetWord(GifFileType *GifFile, GifWord *Word); - static int DGifSetupDecompress(GifFileType *GifFile); - static int DGifDecompressLine(GifFileType *GifFile, GifPixelType *Line, - int LineLen); --static int DGifGetPrefixChar(GifPrefixType *Prefix, int Code, int ClearCode); -+static int DGifGetPrefixChar(const GifPrefixType *Prefix, int Code, -+ int ClearCode); - static int DGifDecompressInput(GifFileType *GifFile, int *Code); - static int DGifBufferedInput(GifFileType *GifFile, GifByteType *Buf, - GifByteType *NextByte); -@@ -76,15 +77,14 @@ static int DGifBufferedInput(GifFileType *GifFile, GifByteType *Buf, - Returns dynamically allocated GifFileType pointer which serves as the GIF - info record. - ******************************************************************************/ --GifFileType * --DGifOpenFileName(const char *FileName, int *Error) --{ -+GifFileType *DGifOpenFileName(const char *FileName, int *Error) { - int FileHandle; - GifFileType *GifFile; - - if ((FileHandle = open(FileName, O_RDONLY)) == -1) { -- if (Error != NULL) -+ if (Error != NULL) { - *Error = D_GIF_ERR_OPEN_FAILED; -+ } - return NULL; - } - -@@ -97,9 +97,7 @@ DGifOpenFileName(const char *FileName, int *Error) - Returns dynamically allocated GifFileType pointer which serves as the GIF - info record. - ******************************************************************************/ --GifFileType * --DGifOpenFileHandle(int FileHandle, int *Error) --{ -+GifFileType *DGifOpenFileHandle(int FileHandle, int *Error) { - char Buf[GIF_STAMP_LEN + 1]; - GifFileType *GifFile; - GifFilePrivateType *Private; -@@ -107,13 +105,14 @@ DGifOpenFileHandle(int FileHandle, int *Error) - - GifFile = (GifFileType *)malloc(sizeof(GifFileType)); - if (GifFile == NULL) { -- if (Error != NULL) -+ if (Error != NULL) { - *Error = D_GIF_ERR_NOT_ENOUGH_MEM; -+ } - (void)close(FileHandle); - return NULL; - } - -- /*@i1@*/memset(GifFile, '\0', sizeof(GifFileType)); -+ /*@i1@*/ memset(GifFile, '\0', sizeof(GifFileType)); - - /* Belt and suspenders, in case the null pointer isn't zero */ - GifFile->SavedImages = NULL; -@@ -121,35 +120,38 @@ DGifOpenFileHandle(int FileHandle, int *Error) - - Private = (GifFilePrivateType *)calloc(1, sizeof(GifFilePrivateType)); - if (Private == NULL) { -- if (Error != NULL) -+ if (Error != NULL) { - *Error = D_GIF_ERR_NOT_ENOUGH_MEM; -+ } - (void)close(FileHandle); - free((char *)GifFile); - return NULL; - } - -- /*@i1@*/memset(Private, '\0', sizeof(GifFilePrivateType)); -+ /*@i1@*/ memset(Private, '\0', sizeof(GifFilePrivateType)); - - #ifdef _WIN32 -- _setmode(FileHandle, O_BINARY); /* Make sure it is in binary mode. */ --#endif /* _WIN32 */ -+ _setmode(FileHandle, O_BINARY); /* Make sure it is in binary mode. */ -+#endif /* _WIN32 */ - -- f = fdopen(FileHandle, "rb"); /* Make it into a stream: */ -+ f = fdopen(FileHandle, "rb"); /* Make it into a stream: */ - - /*@-mustfreeonly@*/ - GifFile->Private = (void *)Private; - Private->FileHandle = FileHandle; - Private->File = f; - Private->FileState = FILE_STATE_READ; -- Private->Read = NULL; /* don't use alternate input method (TVT) */ -- GifFile->UserData = NULL; /* TVT */ -+ Private->Read = NULL; /* don't use alternate input method (TVT) */ -+ GifFile->UserData = NULL; /* TVT */ - /*@=mustfreeonly@*/ - - /* Let's see if this is a GIF file: */ - /* coverity[check_return] */ -- if (InternalRead(GifFile, (unsigned char *)Buf, GIF_STAMP_LEN) != GIF_STAMP_LEN) { -- if (Error != NULL) -+ if (InternalRead(GifFile, (unsigned char *)Buf, GIF_STAMP_LEN) != -+ GIF_STAMP_LEN) { -+ if (Error != NULL) { - *Error = D_GIF_ERR_READ_FAILED; -+ } - (void)fclose(f); - free((char *)Private); - free((char *)GifFile); -@@ -159,8 +161,9 @@ DGifOpenFileHandle(int FileHandle, int *Error) - /* Check for GIF prefix at start of file */ - Buf[GIF_STAMP_LEN] = 0; - if (strncmp(GIF_STAMP, Buf, GIF_VERSION_POS) != 0) { -- if (Error != NULL) -+ if (Error != NULL) { - *Error = D_GIF_ERR_NOT_GIF_FILE; -+ } - (void)fclose(f); - free((char *)Private); - free((char *)GifFile); -@@ -177,7 +180,7 @@ DGifOpenFileHandle(int FileHandle, int *Error) - GifFile->Error = 0; - - /* What version of GIF? */ -- Private->gif89 = (Buf[GIF_VERSION_POS] == '9'); -+ Private->gif89 = (Buf[GIF_VERSION_POS + 1] == '9'); - - return GifFile; - } -@@ -185,17 +188,16 @@ DGifOpenFileHandle(int FileHandle, int *Error) - /****************************************************************************** - GifFileType constructor with user supplied input function (TVT) - ******************************************************************************/ --GifFileType * --DGifOpen(void *userData, InputFunc readFunc, int *Error) --{ -+GifFileType *DGifOpen(void *userData, InputFunc readFunc, int *Error) { - char Buf[GIF_STAMP_LEN + 1]; - GifFileType *GifFile; - GifFilePrivateType *Private; - - GifFile = (GifFileType *)malloc(sizeof(GifFileType)); - if (GifFile == NULL) { -- if (Error != NULL) -+ if (Error != NULL) { - *Error = D_GIF_ERR_NOT_ENOUGH_MEM; -+ } - return NULL; - } - -@@ -207,26 +209,29 @@ DGifOpen(void *userData, InputFunc readFunc, int *Error) - - Private = (GifFilePrivateType *)calloc(1, sizeof(GifFilePrivateType)); - if (!Private) { -- if (Error != NULL) -+ if (Error != NULL) { - *Error = D_GIF_ERR_NOT_ENOUGH_MEM; -+ } - free((char *)GifFile); - return NULL; - } -- /*@i1@*/memset(Private, '\0', sizeof(GifFilePrivateType)); -+ /*@i1@*/ memset(Private, '\0', sizeof(GifFilePrivateType)); - - GifFile->Private = (void *)Private; - Private->FileHandle = 0; - Private->File = NULL; - Private->FileState = FILE_STATE_READ; - -- Private->Read = readFunc; /* TVT */ -- GifFile->UserData = userData; /* TVT */ -+ Private->Read = readFunc; /* TVT */ -+ GifFile->UserData = userData; /* TVT */ - - /* Lets see if this is a GIF file: */ - /* coverity[check_return] */ -- if (InternalRead(GifFile, (unsigned char *)Buf, GIF_STAMP_LEN) != GIF_STAMP_LEN) { -- if (Error != NULL) -+ if (InternalRead(GifFile, (unsigned char *)Buf, GIF_STAMP_LEN) != -+ GIF_STAMP_LEN) { -+ if (Error != NULL) { - *Error = D_GIF_ERR_READ_FAILED; -+ } - free((char *)Private); - free((char *)GifFile); - return NULL; -@@ -235,8 +240,9 @@ DGifOpen(void *userData, InputFunc readFunc, int *Error) - /* Check for GIF prefix at start of file */ - Buf[GIF_STAMP_LEN] = '\0'; - if (strncmp(GIF_STAMP, Buf, GIF_VERSION_POS) != 0) { -- if (Error != NULL) -+ if (Error != NULL) { - *Error = D_GIF_ERR_NOT_GIF_FILE; -+ } - free((char *)Private); - free((char *)GifFile); - return NULL; -@@ -245,15 +251,16 @@ DGifOpen(void *userData, InputFunc readFunc, int *Error) - if (DGifGetScreenDesc(GifFile) == GIF_ERROR) { - free((char *)Private); - free((char *)GifFile); -- if (Error != NULL) -+ if (Error != NULL) { - *Error = D_GIF_ERR_NO_SCRN_DSCR; -+ } - return NULL; - } - - GifFile->Error = 0; - - /* What version of GIF? */ -- Private->gif89 = (Buf[GIF_VERSION_POS] == '9'); -+ Private->gif89 = (Buf[GIF_VERSION_POS + 1] == '9'); - - return GifFile; - } -@@ -262,9 +269,7 @@ DGifOpen(void *userData, InputFunc readFunc, int *Error) - This routine should be called before any other DGif calls. Note that - this routine is called automatically from DGif file open routines. - ******************************************************************************/ --int --DGifGetScreenDesc(GifFileType *GifFile) --{ -+int DGifGetScreenDesc(GifFileType *GifFile) { - int BitsPerPixel; - bool SortFlag; - GifByteType Buf[3]; -@@ -278,8 +283,9 @@ DGifGetScreenDesc(GifFileType *GifFile) - - /* Put the screen descriptor into the file: */ - if (DGifGetWord(GifFile, &GifFile->SWidth) == GIF_ERROR || -- DGifGetWord(GifFile, &GifFile->SHeight) == GIF_ERROR) -+ DGifGetWord(GifFile, &GifFile->SHeight) == GIF_ERROR) { - return GIF_ERROR; -+ } - - if (InternalRead(GifFile, Buf, 3) != 3) { - GifFile->Error = D_GIF_ERR_READ_FAILED; -@@ -292,7 +298,7 @@ DGifGetScreenDesc(GifFileType *GifFile) - BitsPerPixel = (Buf[0] & 0x07) + 1; - GifFile->SBackGroundColor = Buf[1]; - GifFile->AspectByte = Buf[2]; -- if (Buf[0] & 0x80) { /* Do we have global color map? */ -+ if (Buf[0] & 0x80) { /* Do we have global color map? */ - int i; - - GifFile->SColorMap = GifMakeMapObject(1 << BitsPerPixel, NULL); -@@ -327,23 +333,20 @@ DGifGetScreenDesc(GifFileType *GifFile) - return GIF_OK; - } - --const char * --DGifGetGifVersion(GifFileType *GifFile) --{ -- GifFilePrivateType *Private = (GifFilePrivateType *) GifFile->Private; -+const char *DGifGetGifVersion(GifFileType *GifFile) { -+ GifFilePrivateType *Private = (GifFilePrivateType *)GifFile->Private; - -- if (Private->gif89) -+ if (Private->gif89) { - return GIF89_STAMP; -- else -+ } else { - return GIF87_STAMP; -+ } - } - - /****************************************************************************** - This routine should be called before any attempt to read an image. - ******************************************************************************/ --int --DGifGetRecordType(GifFileType *GifFile, GifRecordType* Type) --{ -+int DGifGetRecordType(GifFileType *GifFile, GifRecordType *Type) { - GifByteType Buf; - GifFilePrivateType *Private = (GifFilePrivateType *)GifFile->Private; - -@@ -359,29 +362,27 @@ DGifGetRecordType(GifFileType *GifFile, GifRecordType* Type) - return GIF_ERROR; - } - -- //fprintf(stderr, "### DGifGetRecordType: %02x\n", Buf); -+ // fprintf(stderr, "### DGifGetRecordType: %02x\n", Buf); - switch (Buf) { -- case DESCRIPTOR_INTRODUCER: -- *Type = IMAGE_DESC_RECORD_TYPE; -- break; -- case EXTENSION_INTRODUCER: -- *Type = EXTENSION_RECORD_TYPE; -- break; -- case TERMINATOR_INTRODUCER: -- *Type = TERMINATE_RECORD_TYPE; -- break; -- default: -- *Type = UNDEFINED_RECORD_TYPE; -- GifFile->Error = D_GIF_ERR_WRONG_RECORD; -- return GIF_ERROR; -+ case DESCRIPTOR_INTRODUCER: -+ *Type = IMAGE_DESC_RECORD_TYPE; -+ break; -+ case EXTENSION_INTRODUCER: -+ *Type = EXTENSION_RECORD_TYPE; -+ break; -+ case TERMINATOR_INTRODUCER: -+ *Type = TERMINATE_RECORD_TYPE; -+ break; -+ default: -+ *Type = UNDEFINED_RECORD_TYPE; -+ GifFile->Error = D_GIF_ERR_WRONG_RECORD; -+ return GIF_ERROR; - } - - return GIF_OK; - } - --int --DGifGetImageHeader(GifFileType *GifFile) --{ -+int DGifGetImageHeader(GifFileType *GifFile) { - unsigned int BitsPerPixel; - GifByteType Buf[3]; - GifFilePrivateType *Private = (GifFilePrivateType *)GifFile->Private; -@@ -395,8 +396,9 @@ DGifGetImageHeader(GifFileType *GifFile) - if (DGifGetWord(GifFile, &GifFile->Image.Left) == GIF_ERROR || - DGifGetWord(GifFile, &GifFile->Image.Top) == GIF_ERROR || - DGifGetWord(GifFile, &GifFile->Image.Width) == GIF_ERROR || -- DGifGetWord(GifFile, &GifFile->Image.Height) == GIF_ERROR) -+ DGifGetWord(GifFile, &GifFile->Image.Height) == GIF_ERROR) { - return GIF_ERROR; -+ } - if (InternalRead(GifFile, Buf, 1) != 1) { - GifFile->Error = D_GIF_ERR_READ_FAILED; - GifFreeMapObject(GifFile->Image.ColorMap); -@@ -415,7 +417,8 @@ DGifGetImageHeader(GifFileType *GifFile) - if (Buf[0] & 0x80) { - unsigned int i; - -- GifFile->Image.ColorMap = GifMakeMapObject(1 << BitsPerPixel, NULL); -+ GifFile->Image.ColorMap = -+ GifMakeMapObject(1 << BitsPerPixel, NULL); - if (GifFile->Image.ColorMap == NULL) { - GifFile->Error = D_GIF_ERR_NOT_ENOUGH_MEM; - return GIF_ERROR; -@@ -436,8 +439,8 @@ DGifGetImageHeader(GifFileType *GifFile) - } - } - -- Private->PixelCount = (long)GifFile->Image.Width * -- (long)GifFile->Image.Height; -+ Private->PixelCount = -+ (long)GifFile->Image.Width * (long)GifFile->Image.Height; - - /* Reset decompress algorithm parameters. */ - return DGifSetupDecompress(GifFile); -@@ -447,9 +450,7 @@ DGifGetImageHeader(GifFileType *GifFile) - This routine should be called before any attempt to read an image. - Note it is assumed the Image desc. header has been read. - ******************************************************************************/ --int --DGifGetImageDesc(GifFileType *GifFile) --{ -+int DGifGetImageDesc(GifFileType *GifFile) { - GifFilePrivateType *Private = (GifFilePrivateType *)GifFile->Private; - SavedImage *sp; - -@@ -464,9 +465,9 @@ DGifGetImageDesc(GifFileType *GifFile) - } - - if (GifFile->SavedImages) { -- SavedImage* new_saved_images = -- (SavedImage *)reallocarray(GifFile->SavedImages, -- (GifFile->ImageCount + 1), sizeof(SavedImage)); -+ SavedImage *new_saved_images = (SavedImage *)reallocarray( -+ GifFile->SavedImages, (GifFile->ImageCount + 1), -+ sizeof(SavedImage)); - if (new_saved_images == NULL) { - GifFile->Error = D_GIF_ERR_NOT_ENOUGH_MEM; - return GIF_ERROR; -@@ -474,7 +475,7 @@ DGifGetImageDesc(GifFileType *GifFile) - GifFile->SavedImages = new_saved_images; - } else { - if ((GifFile->SavedImages = -- (SavedImage *) malloc(sizeof(SavedImage))) == NULL) { -+ (SavedImage *)malloc(sizeof(SavedImage))) == NULL) { - GifFile->Error = D_GIF_ERR_NOT_ENOUGH_MEM; - return GIF_ERROR; - } -@@ -483,9 +484,9 @@ DGifGetImageDesc(GifFileType *GifFile) - sp = &GifFile->SavedImages[GifFile->ImageCount]; - memcpy(&sp->ImageDesc, &GifFile->Image, sizeof(GifImageDesc)); - if (GifFile->Image.ColorMap != NULL) { -- sp->ImageDesc.ColorMap = GifMakeMapObject( -- GifFile->Image.ColorMap->ColorCount, -- GifFile->Image.ColorMap->Colors); -+ sp->ImageDesc.ColorMap = -+ GifMakeMapObject(GifFile->Image.ColorMap->ColorCount, -+ GifFile->Image.ColorMap->Colors); - if (sp->ImageDesc.ColorMap == NULL) { - GifFile->Error = D_GIF_ERR_NOT_ENOUGH_MEM; - return GIF_ERROR; -@@ -493,7 +494,7 @@ DGifGetImageDesc(GifFileType *GifFile) - } - sp->RasterBits = (unsigned char *)NULL; - sp->ExtensionBlockCount = 0; -- sp->ExtensionBlocks = (ExtensionBlock *) NULL; -+ sp->ExtensionBlocks = (ExtensionBlock *)NULL; - - GifFile->ImageCount++; - -@@ -503,11 +504,9 @@ DGifGetImageDesc(GifFileType *GifFile) - /****************************************************************************** - Get one full scanned line (Line) of length LineLen from GIF file. - ******************************************************************************/ --int --DGifGetLine(GifFileType *GifFile, GifPixelType *Line, int LineLen) --{ -+int DGifGetLine(GifFileType *GifFile, GifPixelType *Line, int LineLen) { - GifByteType *Dummy; -- GifFilePrivateType *Private = (GifFilePrivateType *) GifFile->Private; -+ GifFilePrivateType *Private = (GifFilePrivateType *)GifFile->Private; - - if (!IS_READABLE(Private)) { - /* This file was NOT open for reading: */ -@@ -515,8 +514,9 @@ DGifGetLine(GifFileType *GifFile, GifPixelType *Line, int LineLen) - return GIF_ERROR; - } - -- if (!LineLen) -+ if (!LineLen) { - LineLen = GifFile->Image.Width; -+ } - - if ((Private->PixelCount -= LineLen) > 0xffff0000UL) { - GifFile->Error = D_GIF_ERR_DATA_TOO_BIG; -@@ -525,56 +525,59 @@ DGifGetLine(GifFileType *GifFile, GifPixelType *Line, int LineLen) - - if (DGifDecompressLine(GifFile, Line, LineLen) == GIF_OK) { - if (Private->PixelCount == 0) { -- /* We probably won't be called any more, so let's clean up -- * everything before we return: need to flush out all the -- * rest of image until an empty block (size 0) -+ /* We probably won't be called any more, so let's clean -+ * up everything before we return: need to flush out all -+ * the rest of image until an empty block (size 0) - * detected. We use GetCodeNext. - */ -- do -- if (DGifGetCodeNext(GifFile, &Dummy) == GIF_ERROR) -+ do { -+ if (DGifGetCodeNext(GifFile, &Dummy) == -+ GIF_ERROR) { - return GIF_ERROR; -- while (Dummy != NULL) ; -+ } -+ } while (Dummy != NULL); - } - return GIF_OK; -- } else -+ } else { - return GIF_ERROR; -+ } - } - - /****************************************************************************** - Put one pixel (Pixel) into GIF file. - ******************************************************************************/ --int --DGifGetPixel(GifFileType *GifFile, GifPixelType Pixel) --{ -+int DGifGetPixel(GifFileType *GifFile, GifPixelType Pixel) { - GifByteType *Dummy; -- GifFilePrivateType *Private = (GifFilePrivateType *) GifFile->Private; -+ GifFilePrivateType *Private = (GifFilePrivateType *)GifFile->Private; - - if (!IS_READABLE(Private)) { - /* This file was NOT open for reading: */ - GifFile->Error = D_GIF_ERR_NOT_READABLE; - return GIF_ERROR; - } -- if (--Private->PixelCount > 0xffff0000UL) -- { -+ if (--Private->PixelCount > 0xffff0000UL) { - GifFile->Error = D_GIF_ERR_DATA_TOO_BIG; - return GIF_ERROR; - } - - if (DGifDecompressLine(GifFile, &Pixel, 1) == GIF_OK) { - if (Private->PixelCount == 0) { -- /* We probably won't be called any more, so let's clean up -- * everything before we return: need to flush out all the -- * rest of image until an empty block (size 0) -+ /* We probably won't be called any more, so let's clean -+ * up everything before we return: need to flush out all -+ * the rest of image until an empty block (size 0) - * detected. We use GetCodeNext. - */ -- do -- if (DGifGetCodeNext(GifFile, &Dummy) == GIF_ERROR) -+ do { -+ if (DGifGetCodeNext(GifFile, &Dummy) == -+ GIF_ERROR) { - return GIF_ERROR; -- while (Dummy != NULL) ; -+ } -+ } while (Dummy != NULL); - } - return GIF_OK; -- } else -+ } else { - return GIF_ERROR; -+ } - } - - /****************************************************************************** -@@ -584,13 +587,12 @@ DGifGetPixel(GifFileType *GifFile, GifPixelType Pixel) - The Extension should NOT be freed by the user (not dynamically allocated). - Note it is assumed the Extension description header has been read. - ******************************************************************************/ --int --DGifGetExtension(GifFileType *GifFile, int *ExtCode, GifByteType **Extension) --{ -+int DGifGetExtension(GifFileType *GifFile, int *ExtCode, -+ GifByteType **Extension) { - GifByteType Buf; - GifFilePrivateType *Private = (GifFilePrivateType *)GifFile->Private; - -- //fprintf(stderr, "### -> DGifGetExtension:\n"); -+ // fprintf(stderr, "### -> DGifGetExtension:\n"); - if (!IS_READABLE(Private)) { - /* This file was NOT open for reading: */ - GifFile->Error = D_GIF_ERR_NOT_READABLE; -@@ -603,7 +605,8 @@ DGifGetExtension(GifFileType *GifFile, int *ExtCode, GifByteType **Extension) - return GIF_ERROR; - } - *ExtCode = Buf; -- //fprintf(stderr, "### <- DGifGetExtension: %02x, about to call next\n", Buf); -+ // fprintf(stderr, "### <- DGifGetExtension: %02x, about to call -+ // next\n", Buf); - - return DGifGetExtensionNext(GifFile, Extension); - } -@@ -613,30 +616,30 @@ DGifGetExtension(GifFileType *GifFile, int *ExtCode, GifByteType **Extension) - routine should be called until NULL Extension is returned. - The Extension should NOT be freed by the user (not dynamically allocated). - ******************************************************************************/ --int --DGifGetExtensionNext(GifFileType *GifFile, GifByteType ** Extension) --{ -+int DGifGetExtensionNext(GifFileType *GifFile, GifByteType **Extension) { - GifByteType Buf; - GifFilePrivateType *Private = (GifFilePrivateType *)GifFile->Private; - -- //fprintf(stderr, "### -> DGifGetExtensionNext\n"); -+ // fprintf(stderr, "### -> DGifGetExtensionNext\n"); - if (InternalRead(GifFile, &Buf, 1) != 1) { - GifFile->Error = D_GIF_ERR_READ_FAILED; - return GIF_ERROR; - } -- //fprintf(stderr, "### DGifGetExtensionNext sees %d\n", Buf); -+ // fprintf(stderr, "### DGifGetExtensionNext sees %d\n", Buf); - - if (Buf > 0) { -- *Extension = Private->Buf; /* Use private unused buffer. */ -- (*Extension)[0] = Buf; /* Pascal strings notation (pos. 0 is len.). */ -- /* coverity[tainted_data,check_return] */ -+ *Extension = Private->Buf; /* Use private unused buffer. */ -+ (*Extension)[0] = -+ Buf; /* Pascal strings notation (pos. 0 is len.). */ -+ /* coverity[tainted_data,check_return] */ - if (InternalRead(GifFile, &((*Extension)[1]), Buf) != Buf) { - GifFile->Error = D_GIF_ERR_READ_FAILED; - return GIF_ERROR; - } -- } else -+ } else { - *Extension = NULL; -- //fprintf(stderr, "### <- DGifGetExtensionNext: %p\n", Extension); -+ } -+ // fprintf(stderr, "### <- DGifGetExtensionNext: %p\n", Extension); - - return GIF_OK; - } -@@ -647,19 +650,20 @@ DGifGetExtensionNext(GifFileType *GifFile, GifByteType ** Extension) - - int DGifExtensionToGCB(const size_t GifExtensionLength, - const GifByteType *GifExtension, -- GraphicsControlBlock *GCB) --{ -+ GraphicsControlBlock *GCB) { - if (GifExtensionLength != 4) { - return GIF_ERROR; - } - - GCB->DisposalMode = (GifExtension[0] >> 2) & 0x07; - GCB->UserInputFlag = (GifExtension[0] & 0x02) != 0; -- GCB->DelayTime = UNSIGNED_LITTLE_ENDIAN(GifExtension[1], GifExtension[2]); -- if (GifExtension[0] & 0x01) -+ GCB->DelayTime = -+ UNSIGNED_LITTLE_ENDIAN(GifExtension[1], GifExtension[2]); -+ if (GifExtension[0] & 0x01) { - GCB->TransparentColor = (int)GifExtension[3]; -- else -+ } else { - GCB->TransparentColor = NO_TRANSPARENT_COLOR; -+ } - - return GIF_OK; - } -@@ -668,23 +672,27 @@ int DGifExtensionToGCB(const size_t GifExtensionLength, - Extract the Graphics Control Block for a saved image, if it exists. - ******************************************************************************/ - --int DGifSavedExtensionToGCB(GifFileType *GifFile, -- int ImageIndex, GraphicsControlBlock *GCB) --{ -+int DGifSavedExtensionToGCB(GifFileType *GifFile, int ImageIndex, -+ GraphicsControlBlock *GCB) { - int i; - -- if (ImageIndex < 0 || ImageIndex > GifFile->ImageCount - 1) -+ if (ImageIndex < 0 || ImageIndex > GifFile->ImageCount - 1) { - return GIF_ERROR; -+ } - - GCB->DisposalMode = DISPOSAL_UNSPECIFIED; - GCB->UserInputFlag = false; - GCB->DelayTime = 0; - GCB->TransparentColor = NO_TRANSPARENT_COLOR; - -- for (i = 0; i < GifFile->SavedImages[ImageIndex].ExtensionBlockCount; i++) { -- ExtensionBlock *ep = &GifFile->SavedImages[ImageIndex].ExtensionBlocks[i]; -- if (ep->Function == GRAPHICS_EXT_FUNC_CODE) -- return DGifExtensionToGCB(ep->ByteCount, ep->Bytes, GCB); -+ for (i = 0; i < GifFile->SavedImages[ImageIndex].ExtensionBlockCount; -+ i++) { -+ ExtensionBlock *ep = -+ &GifFile->SavedImages[ImageIndex].ExtensionBlocks[i]; -+ if (ep->Function == GRAPHICS_EXT_FUNC_CODE) { -+ return DGifExtensionToGCB(ep->ByteCount, ep->Bytes, -+ GCB); -+ } - } - - return GIF_ERROR; -@@ -693,13 +701,12 @@ int DGifSavedExtensionToGCB(GifFileType *GifFile, - /****************************************************************************** - This routine should be called last, to close the GIF file. - ******************************************************************************/ --int --DGifCloseFile(GifFileType *GifFile, int *ErrorCode) --{ -+int DGifCloseFile(GifFileType *GifFile, int *ErrorCode) { - GifFilePrivateType *Private; - -- if (GifFile == NULL || GifFile->Private == NULL) -+ if (GifFile == NULL || GifFile->Private == NULL) { - return GIF_ERROR; -+ } - - if (GifFile->Image.ColorMap) { - GifFreeMapObject(GifFile->Image.ColorMap); -@@ -716,22 +723,25 @@ DGifCloseFile(GifFileType *GifFile, int *ErrorCode) - GifFile->SavedImages = NULL; - } - -- GifFreeExtensions(&GifFile->ExtensionBlockCount, &GifFile->ExtensionBlocks); -+ GifFreeExtensions(&GifFile->ExtensionBlockCount, -+ &GifFile->ExtensionBlocks); - -- Private = (GifFilePrivateType *) GifFile->Private; -+ Private = (GifFilePrivateType *)GifFile->Private; - - if (!IS_READABLE(Private)) { - /* This file was NOT open for reading: */ -- if (ErrorCode != NULL) -+ if (ErrorCode != NULL) { - *ErrorCode = D_GIF_ERR_NOT_READABLE; -+ } - free((char *)GifFile->Private); - free(GifFile); - return GIF_ERROR; - } - - if (Private->File && (fclose(Private->File) != 0)) { -- if (ErrorCode != NULL) -+ if (ErrorCode != NULL) { - *ErrorCode = D_GIF_ERR_CLOSE_FAILED; -+ } - free((char *)GifFile->Private); - free(GifFile); - return GIF_ERROR; -@@ -739,17 +749,16 @@ DGifCloseFile(GifFileType *GifFile, int *ErrorCode) - - free((char *)GifFile->Private); - free(GifFile); -- if (ErrorCode != NULL) -+ if (ErrorCode != NULL) { - *ErrorCode = D_GIF_SUCCEEDED; -+ } - return GIF_OK; - } - - /****************************************************************************** - Get 2 bytes (word) from the given file: - ******************************************************************************/ --static int --DGifGetWord(GifFileType *GifFile, GifWord *Word) --{ -+static int DGifGetWord(GifFileType *GifFile, GifWord *Word) { - unsigned char c[2]; - - /* coverity[check_return] */ -@@ -769,9 +778,7 @@ DGifGetWord(GifFileType *GifFile, GifWord *Word) - to DGifGetCodeNext, until NULL block is returned. - The block should NOT be freed by the user (not dynamically allocated). - ******************************************************************************/ --int --DGifGetCode(GifFileType *GifFile, int *CodeSize, GifByteType **CodeBlock) --{ -+int DGifGetCode(GifFileType *GifFile, int *CodeSize, GifByteType **CodeBlock) { - GifFilePrivateType *Private = (GifFilePrivateType *)GifFile->Private; - - if (!IS_READABLE(Private)) { -@@ -790,9 +797,7 @@ DGifGetCode(GifFileType *GifFile, int *CodeSize, GifByteType **CodeBlock) - called until NULL block is returned. - The block should NOT be freed by the user (not dynamically allocated). - ******************************************************************************/ --int --DGifGetCodeNext(GifFileType *GifFile, GifByteType **CodeBlock) --{ -+int DGifGetCodeNext(GifFileType *GifFile, GifByteType **CodeBlock) { - GifByteType Buf; - GifFilePrivateType *Private = (GifFilePrivateType *)GifFile->Private; - -@@ -805,17 +810,19 @@ DGifGetCodeNext(GifFileType *GifFile, GifByteType **CodeBlock) - - /* coverity[lower_bounds] */ - if (Buf > 0) { -- *CodeBlock = Private->Buf; /* Use private unused buffer. */ -- (*CodeBlock)[0] = Buf; /* Pascal strings notation (pos. 0 is len.). */ -- /* coverity[tainted_data] */ -+ *CodeBlock = Private->Buf; /* Use private unused buffer. */ -+ (*CodeBlock)[0] = -+ Buf; /* Pascal strings notation (pos. 0 is len.). */ -+ /* coverity[tainted_data] */ - if (InternalRead(GifFile, &((*CodeBlock)[1]), Buf) != Buf) { - GifFile->Error = D_GIF_ERR_READ_FAILED; - return GIF_ERROR; - } - } else { - *CodeBlock = NULL; -- Private->Buf[0] = 0; /* Make sure the buffer is empty! */ -- Private->PixelCount = 0; /* And local info. indicate image read. */ -+ Private->Buf[0] = 0; /* Make sure the buffer is empty! */ -+ Private->PixelCount = -+ 0; /* And local info. indicate image read. */ - } - - return GIF_OK; -@@ -824,41 +831,43 @@ DGifGetCodeNext(GifFileType *GifFile, GifByteType **CodeBlock) - /****************************************************************************** - Setup the LZ decompression for this image: - ******************************************************************************/ --static int --DGifSetupDecompress(GifFileType *GifFile) --{ -+static int DGifSetupDecompress(GifFileType *GifFile) { - int i, BitsPerPixel; - GifByteType CodeSize; - GifPrefixType *Prefix; - GifFilePrivateType *Private = (GifFilePrivateType *)GifFile->Private; - - /* coverity[check_return] */ -- if (InternalRead(GifFile, &CodeSize, 1) < 1) { /* Read Code size from file. */ -- return GIF_ERROR; /* Failed to read Code size. */ -+ if (InternalRead(GifFile, &CodeSize, 1) < -+ 1) { /* Read Code size from file. */ -+ GifFile->Error = D_GIF_ERR_READ_FAILED; -+ return GIF_ERROR; /* Failed to read Code size. */ - } - BitsPerPixel = CodeSize; - - /* this can only happen on a severely malformed GIF */ - if (BitsPerPixel > 8) { -- GifFile->Error = D_GIF_ERR_READ_FAILED; /* somewhat bogus error code */ -- return GIF_ERROR; /* Failed to read Code size. */ -+ GifFile->Error = -+ D_GIF_ERR_READ_FAILED; /* somewhat bogus error code */ -+ return GIF_ERROR; /* Failed to read Code size. */ - } - -- Private->Buf[0] = 0; /* Input Buffer empty. */ -+ Private->Buf[0] = 0; /* Input Buffer empty. */ - Private->BitsPerPixel = BitsPerPixel; - Private->ClearCode = (1 << BitsPerPixel); - Private->EOFCode = Private->ClearCode + 1; - Private->RunningCode = Private->EOFCode + 1; -- Private->RunningBits = BitsPerPixel + 1; /* Number of bits per code. */ -- Private->MaxCode1 = 1 << Private->RunningBits; /* Max. code + 1. */ -- Private->StackPtr = 0; /* No pixels on the pixel stack. */ -+ Private->RunningBits = BitsPerPixel + 1; /* Number of bits per code. */ -+ Private->MaxCode1 = 1 << Private->RunningBits; /* Max. code + 1. */ -+ Private->StackPtr = 0; /* No pixels on the pixel stack. */ - Private->LastCode = NO_SUCH_CODE; -- Private->CrntShiftState = 0; /* No information in CrntShiftDWord. */ -+ Private->CrntShiftState = 0; /* No information in CrntShiftDWord. */ - Private->CrntShiftDWord = 0; - - Prefix = Private->Prefix; -- for (i = 0; i <= LZ_MAX_CODE; i++) -+ for (i = 0; i <= LZ_MAX_CODE; i++) { - Prefix[i] = NO_SUCH_CODE; -+ } - - return GIF_OK; - } -@@ -869,14 +878,13 @@ DGifSetupDecompress(GifFileType *GifFile) - This routine can be called few times (one per scan line, for example), in - order the complete the whole image. - ******************************************************************************/ --static int --DGifDecompressLine(GifFileType *GifFile, GifPixelType *Line, int LineLen) --{ -+static int DGifDecompressLine(GifFileType *GifFile, GifPixelType *Line, -+ int LineLen) { - int i = 0; - int j, CrntCode, EOFCode, ClearCode, CrntPrefix, LastCode, StackPtr; - GifByteType *Stack, *Suffix; - GifPrefixType *Prefix; -- GifFilePrivateType *Private = (GifFilePrivateType *) GifFile->Private; -+ GifFilePrivateType *Private = (GifFilePrivateType *)GifFile->Private; - - StackPtr = Private->StackPtr; - Prefix = Private->Prefix; -@@ -891,72 +899,88 @@ DGifDecompressLine(GifFileType *GifFile, GifPixelType *Line, int LineLen) - } - - if (StackPtr != 0) { -- /* Let pop the stack off before continueing to read the GIF file: */ -- while (StackPtr != 0 && i < LineLen) -+ /* Let pop the stack off before continueing to read the GIF -+ * file: */ -+ while (StackPtr != 0 && i < LineLen) { - Line[i++] = Stack[--StackPtr]; -+ } - } - -- while (i < LineLen) { /* Decode LineLen items. */ -- if (DGifDecompressInput(GifFile, &CrntCode) == GIF_ERROR) -+ while (i < LineLen) { /* Decode LineLen items. */ -+ if (DGifDecompressInput(GifFile, &CrntCode) == GIF_ERROR) { - return GIF_ERROR; -+ } - - if (CrntCode == EOFCode) { -- /* Note however that usually we will not be here as we will stop -- * decoding as soon as we got all the pixel, or EOF code will -- * not be read at all, and DGifGetLine/Pixel clean everything. */ -+ /* Note however that usually we will not be here as we -+ * will stop decoding as soon as we got all the pixel, -+ * or EOF code will not be read at all, and -+ * DGifGetLine/Pixel clean everything. */ - GifFile->Error = D_GIF_ERR_EOF_TOO_SOON; - return GIF_ERROR; - } else if (CrntCode == ClearCode) { - /* We need to start over again: */ -- for (j = 0; j <= LZ_MAX_CODE; j++) -+ for (j = 0; j <= LZ_MAX_CODE; j++) { - Prefix[j] = NO_SUCH_CODE; -+ } - Private->RunningCode = Private->EOFCode + 1; - Private->RunningBits = Private->BitsPerPixel + 1; - Private->MaxCode1 = 1 << Private->RunningBits; - LastCode = Private->LastCode = NO_SUCH_CODE; - } else { -- /* Its regular code - if in pixel range simply add it to output -- * stream, otherwise trace to codes linked list until the prefix -- * is in pixel range: */ -+ /* Its regular code - if in pixel range simply add it to -+ * output stream, otherwise trace to codes linked list -+ * until the prefix is in pixel range: */ - if (CrntCode < ClearCode) { -- /* This is simple - its pixel scalar, so add it to output: */ -+ /* This is simple - its pixel scalar, so add it -+ * to output: */ - Line[i++] = CrntCode; - } else { -- /* Its a code to needed to be traced: trace the linked list -- * until the prefix is a pixel, while pushing the suffix -- * pixels on our stack. If we done, pop the stack in reverse -- * (thats what stack is good for!) order to output. */ -+ /* Its a code to needed to be traced: trace the -+ * linked list until the prefix is a pixel, -+ * while pushing the suffix pixels on our stack. -+ * If we done, pop the stack in reverse (thats -+ * what stack is good for!) order to output. */ - if (Prefix[CrntCode] == NO_SUCH_CODE) { - CrntPrefix = LastCode; - -- /* Only allowed if CrntCode is exactly the running code: -- * In that case CrntCode = XXXCode, CrntCode or the -- * prefix code is last code and the suffix char is -- * exactly the prefix of last code! */ -- if (CrntCode == Private->RunningCode - 2) { -- Suffix[Private->RunningCode - 2] = -- Stack[StackPtr++] = DGifGetPrefixChar(Prefix, -- LastCode, -- ClearCode); -+ /* Only allowed if CrntCode is exactly -+ * the running code: In that case -+ * CrntCode = XXXCode, CrntCode or the -+ * prefix code is last code and the -+ * suffix char is exactly the prefix of -+ * last code! */ -+ if (CrntCode == -+ Private->RunningCode - 2) { -+ Suffix[Private->RunningCode - -+ 2] = Stack[StackPtr++] = -+ DGifGetPrefixChar( -+ Prefix, LastCode, -+ ClearCode); - } else { -- Suffix[Private->RunningCode - 2] = -- Stack[StackPtr++] = DGifGetPrefixChar(Prefix, -- CrntCode, -- ClearCode); -+ Suffix[Private->RunningCode - -+ 2] = Stack[StackPtr++] = -+ DGifGetPrefixChar( -+ Prefix, CrntCode, -+ ClearCode); - } -- } else -+ } else { - CrntPrefix = CrntCode; -+ } - -- /* Now (if image is O.K.) we should not get a NO_SUCH_CODE -- * during the trace. As we might loop forever, in case of -- * defective image, we use StackPtr as loop counter and stop -- * before overflowing Stack[]. */ -+ /* Now (if image is O.K.) we should not get a -+ * NO_SUCH_CODE during the trace. As we might -+ * loop forever, in case of defective image, we -+ * use StackPtr as loop counter and stop before -+ * overflowing Stack[]. */ - while (StackPtr < LZ_MAX_CODE && -- CrntPrefix > ClearCode && CrntPrefix <= LZ_MAX_CODE) { -+ CrntPrefix > ClearCode && -+ CrntPrefix <= LZ_MAX_CODE) { - Stack[StackPtr++] = Suffix[CrntPrefix]; - CrntPrefix = Prefix[CrntPrefix]; - } -- if (StackPtr >= LZ_MAX_CODE || CrntPrefix > LZ_MAX_CODE) { -+ if (StackPtr >= LZ_MAX_CODE || -+ CrntPrefix > LZ_MAX_CODE) { - GifFile->Error = D_GIF_ERR_IMAGE_DEFECT; - return GIF_ERROR; - } -@@ -964,22 +988,29 @@ DGifDecompressLine(GifFileType *GifFile, GifPixelType *Line, int LineLen) - Stack[StackPtr++] = CrntPrefix; - - /* Now lets pop all the stack into output: */ -- while (StackPtr != 0 && i < LineLen) -+ while (StackPtr != 0 && i < LineLen) { - Line[i++] = Stack[--StackPtr]; -+ } - } -- if (LastCode != NO_SUCH_CODE && Private->RunningCode - 2 < (LZ_MAX_CODE+1) && Prefix[Private->RunningCode - 2] == NO_SUCH_CODE) { -+ if (LastCode != NO_SUCH_CODE && -+ Private->RunningCode - 2 < (LZ_MAX_CODE + 1) && -+ Prefix[Private->RunningCode - 2] == NO_SUCH_CODE) { - Prefix[Private->RunningCode - 2] = LastCode; - - if (CrntCode == Private->RunningCode - 2) { -- /* Only allowed if CrntCode is exactly the running code: -- * In that case CrntCode = XXXCode, CrntCode or the -- * prefix code is last code and the suffix char is -- * exactly the prefix of last code! */ -+ /* Only allowed if CrntCode is exactly -+ * the running code: In that case -+ * CrntCode = XXXCode, CrntCode or the -+ * prefix code is last code and the -+ * suffix char is exactly the prefix of -+ * last code! */ - Suffix[Private->RunningCode - 2] = -- DGifGetPrefixChar(Prefix, LastCode, ClearCode); -+ DGifGetPrefixChar(Prefix, LastCode, -+ ClearCode); - } else { - Suffix[Private->RunningCode - 2] = -- DGifGetPrefixChar(Prefix, CrntCode, ClearCode); -+ DGifGetPrefixChar(Prefix, CrntCode, -+ ClearCode); - } - } - LastCode = CrntCode; -@@ -998,9 +1029,8 @@ DGifDecompressLine(GifFileType *GifFile, GifPixelType *Line, int LineLen) - If image is defective, we might loop here forever, so we limit the loops to - the maximum possible if image O.k. - LZ_MAX_CODE times. - ******************************************************************************/ --static int --DGifGetPrefixChar(GifPrefixType *Prefix, int Code, int ClearCode) --{ -+static int DGifGetPrefixChar(const GifPrefixType *Prefix, int Code, -+ int ClearCode) { - int i = 0; - - while (Code > ClearCode && i++ <= LZ_MAX_CODE) { -@@ -1016,9 +1046,7 @@ DGifGetPrefixChar(GifPrefixType *Prefix, int Code, int ClearCode) - Interface for accessing the LZ codes directly. Set Code to the real code - (12bits), or to -1 if EOF code is returned. - ******************************************************************************/ --int --DGifGetLZCodes(GifFileType *GifFile, int *Code) --{ -+int DGifGetLZCodes(GifFileType *GifFile, int *Code) { - GifByteType *CodeBlock; - GifFilePrivateType *Private = (GifFilePrivateType *)GifFile->Private; - -@@ -1028,15 +1056,18 @@ DGifGetLZCodes(GifFileType *GifFile, int *Code) - return GIF_ERROR; - } - -- if (DGifDecompressInput(GifFile, Code) == GIF_ERROR) -+ if (DGifDecompressInput(GifFile, Code) == GIF_ERROR) { - return GIF_ERROR; -+ } - - if (*Code == Private->EOFCode) { -- /* Skip rest of codes (hopefully only NULL terminating block): */ -+ /* Skip rest of codes (hopefully only NULL terminating block): -+ */ - do { -- if (DGifGetCodeNext(GifFile, &CodeBlock) == GIF_ERROR) -+ if (DGifGetCodeNext(GifFile, &CodeBlock) == GIF_ERROR) { - return GIF_ERROR; -- } while (CodeBlock != NULL) ; -+ } -+ } while (CodeBlock != NULL); - - *Code = -1; - } else if (*Code == Private->ClearCode) { -@@ -1055,15 +1086,10 @@ DGifGetLZCodes(GifFileType *GifFile, int *Code) - 8 bits (bytes) packets, into the real codes. - Returns GIF_OK if read successfully. - ******************************************************************************/ --static int --DGifDecompressInput(GifFileType *GifFile, int *Code) --{ -+static int DGifDecompressInput(GifFileType *GifFile, int *Code) { - static const unsigned short CodeMasks[] = { -- 0x0000, 0x0001, 0x0003, 0x0007, -- 0x000f, 0x001f, 0x003f, 0x007f, -- 0x00ff, 0x01ff, 0x03ff, 0x07ff, -- 0x0fff -- }; -+ 0x0000, 0x0001, 0x0003, 0x0007, 0x000f, 0x001f, 0x003f, -+ 0x007f, 0x00ff, 0x01ff, 0x03ff, 0x07ff, 0x0fff}; - - GifFilePrivateType *Private = (GifFilePrivateType *)GifFile->Private; - -@@ -1077,11 +1103,12 @@ DGifDecompressInput(GifFileType *GifFile, int *Code) - - while (Private->CrntShiftState < Private->RunningBits) { - /* Needs to get more bytes from input stream for next code: */ -- if (DGifBufferedInput(GifFile, Private->Buf, &NextByte) == GIF_ERROR) { -+ if (DGifBufferedInput(GifFile, Private->Buf, &NextByte) == -+ GIF_ERROR) { - return GIF_ERROR; - } -- Private->CrntShiftDWord |= -- ((unsigned long)NextByte) << Private->CrntShiftState; -+ Private->CrntShiftDWord |= ((unsigned long)NextByte) -+ << Private->CrntShiftState; - Private->CrntShiftState += 8; - } - *Code = Private->CrntShiftDWord & CodeMasks[Private->RunningBits]; -@@ -1109,9 +1136,8 @@ DGifDecompressInput(GifFileType *GifFile, int *Code) - The routine returns the next byte from its internal buffer (or read next - block in if buffer empty) and returns GIF_OK if succesful. - ******************************************************************************/ --static int --DGifBufferedInput(GifFileType *GifFile, GifByteType *Buf, GifByteType *NextByte) --{ -+static int DGifBufferedInput(GifFileType *GifFile, GifByteType *Buf, -+ GifByteType *NextByte) { - if (Buf[0] == 0) { - /* Needs to read the next buffer - this one is empty: */ - /* coverity[check_return] */ -@@ -1120,8 +1146,8 @@ DGifBufferedInput(GifFileType *GifFile, GifByteType *Buf, GifByteType *NextByte) - return GIF_ERROR; - } - /* There shouldn't be any empty data blocks here as the LZW spec -- * says the LZW termination code should come first. Therefore we -- * shouldn't be inside this routine at that point. -+ * says the LZW termination code should come first. Therefore -+ * we shouldn't be inside this routine at that point. - */ - if (Buf[0] == 0) { - GifFile->Error = D_GIF_ERR_IMAGE_DEFECT; -@@ -1132,7 +1158,7 @@ DGifBufferedInput(GifFileType *GifFile, GifByteType *Buf, GifByteType *NextByte) - return GIF_ERROR; - } - *NextByte = Buf[1]; -- Buf[1] = 2; /* We use now the second place as last char read! */ -+ Buf[1] = 2; /* We use now the second place as last char read! */ - Buf[0]--; - } else { - *NextByte = Buf[Buf[1]++]; -@@ -1142,14 +1168,32 @@ DGifBufferedInput(GifFileType *GifFile, GifByteType *Buf, GifByteType *NextByte) - return GIF_OK; - } - -+/****************************************************************************** -+ This routine is called in case of error during parsing image. We need to -+ decrease image counter and reallocate memory for saved images. Not decreasing -+ ImageCount may lead to null pointer dereference, because the last element in -+ SavedImages may point to the spoilt image and null pointer buffers. -+*******************************************************************************/ -+void DGifDecreaseImageCounter(GifFileType *GifFile) { -+ GifFile->ImageCount--; -+ if (GifFile->SavedImages[GifFile->ImageCount].RasterBits != NULL) { -+ free(GifFile->SavedImages[GifFile->ImageCount].RasterBits); -+ } -+ -+ // Realloc array according to the new image counter. -+ SavedImage *correct_saved_images = (SavedImage *)reallocarray( -+ GifFile->SavedImages, GifFile->ImageCount, sizeof(SavedImage)); -+ if (correct_saved_images != NULL) { -+ GifFile->SavedImages = correct_saved_images; -+ } -+} -+ - /****************************************************************************** - This routine reads an entire GIF into core, hanging all its state info off - the GifFileType pointer. Call DGifOpenFileName() or DGifOpenFileHandle() - first to initialize I/O. Its inverse is EGifSpew(). - *******************************************************************************/ --int --DGifSlurp(GifFileType *GifFile) --{ -+int DGifSlurp(GifFileType *GifFile) { - size_t ImageSize; - GifRecordType RecordType; - SavedImage *sp; -@@ -1160,103 +1204,130 @@ DGifSlurp(GifFileType *GifFile) - GifFile->ExtensionBlockCount = 0; - - do { -- if (DGifGetRecordType(GifFile, &RecordType) == GIF_ERROR) -+ if (DGifGetRecordType(GifFile, &RecordType) == GIF_ERROR) { - return (GIF_ERROR); -+ } - - switch (RecordType) { -- case IMAGE_DESC_RECORD_TYPE: -- if (DGifGetImageDesc(GifFile) == GIF_ERROR) -- return (GIF_ERROR); -- -- sp = &GifFile->SavedImages[GifFile->ImageCount - 1]; -- /* Allocate memory for the image */ -- if (sp->ImageDesc.Width <= 0 || sp->ImageDesc.Height <= 0 || -- sp->ImageDesc.Width > (INT_MAX / sp->ImageDesc.Height)) { -- return GIF_ERROR; -- } -- ImageSize = sp->ImageDesc.Width * sp->ImageDesc.Height; -- -- if (ImageSize > (SIZE_MAX / sizeof(GifPixelType))) { -- return GIF_ERROR; -- } -- sp->RasterBits = (unsigned char *)reallocarray(NULL, ImageSize, -- sizeof(GifPixelType)); -- -- if (sp->RasterBits == NULL) { -- return GIF_ERROR; -- } -- -- if (sp->ImageDesc.Interlace) { -- int i, j; -- /* -- * The way an interlaced image should be read - -- * offsets and jumps... -- */ -- int InterlacedOffset[] = { 0, 4, 2, 1 }; -- int InterlacedJumps[] = { 8, 8, 4, 2 }; -- /* Need to perform 4 passes on the image */ -- for (i = 0; i < 4; i++) -- for (j = InterlacedOffset[i]; -- j < sp->ImageDesc.Height; -- j += InterlacedJumps[i]) { -- if (DGifGetLine(GifFile, -- sp->RasterBits+j*sp->ImageDesc.Width, -- sp->ImageDesc.Width) == GIF_ERROR) -- return GIF_ERROR; -- } -- } -- else { -- if (DGifGetLine(GifFile,sp->RasterBits,ImageSize)==GIF_ERROR) -- return (GIF_ERROR); -- } -- -- if (GifFile->ExtensionBlocks) { -- sp->ExtensionBlocks = GifFile->ExtensionBlocks; -- sp->ExtensionBlockCount = GifFile->ExtensionBlockCount; -- -- GifFile->ExtensionBlocks = NULL; -- GifFile->ExtensionBlockCount = 0; -- } -- break; -- -- case EXTENSION_RECORD_TYPE: -- if (DGifGetExtension(GifFile,&ExtFunction,&ExtData) == GIF_ERROR) -- return (GIF_ERROR); -- /* Create an extension block with our data */ -- if (ExtData != NULL) { -- if (GifAddExtensionBlock(&GifFile->ExtensionBlockCount, -- &GifFile->ExtensionBlocks, -- ExtFunction, ExtData[0], &ExtData[1]) -- == GIF_ERROR) -- return (GIF_ERROR); -- } -- for (;;) { -- if (DGifGetExtensionNext(GifFile, &ExtData) == GIF_ERROR) -- return (GIF_ERROR); -- if (ExtData == NULL) -- break; -- /* Continue the extension block */ -- if (ExtData != NULL) -- if (GifAddExtensionBlock(&GifFile->ExtensionBlockCount, -- &GifFile->ExtensionBlocks, -- CONTINUE_EXT_FUNC_CODE, -- ExtData[0], &ExtData[1]) == GIF_ERROR) -- return (GIF_ERROR); -- } -- break; -- -- case TERMINATE_RECORD_TYPE: -- break; -- -- default: /* Should be trapped by DGifGetRecordType */ -- break; -+ case IMAGE_DESC_RECORD_TYPE: -+ if (DGifGetImageDesc(GifFile) == GIF_ERROR) { -+ return (GIF_ERROR); -+ } -+ -+ sp = &GifFile->SavedImages[GifFile->ImageCount - 1]; -+ /* Allocate memory for the image */ -+ if (sp->ImageDesc.Width <= 0 || -+ sp->ImageDesc.Height <= 0 || -+ sp->ImageDesc.Width > -+ (INT_MAX / sp->ImageDesc.Height)) { -+ DGifDecreaseImageCounter(GifFile); -+ return GIF_ERROR; -+ } -+ ImageSize = sp->ImageDesc.Width * sp->ImageDesc.Height; -+ -+ if (ImageSize > (SIZE_MAX / sizeof(GifPixelType))) { -+ DGifDecreaseImageCounter(GifFile); -+ return GIF_ERROR; -+ } -+ sp->RasterBits = (unsigned char *)reallocarray( -+ NULL, ImageSize, sizeof(GifPixelType)); -+ -+ if (sp->RasterBits == NULL) { -+ DGifDecreaseImageCounter(GifFile); -+ return GIF_ERROR; -+ } -+ -+ if (sp->ImageDesc.Interlace) { -+ int i, j; -+ /* -+ * The way an interlaced image should be read - -+ * offsets and jumps... -+ */ -+ static const int InterlacedOffset[] = {0, 4, 2, -+ 1}; -+ static const int InterlacedJumps[] = {8, 8, 4, -+ 2}; -+ /* Need to perform 4 passes on the image */ -+ for (i = 0; i < 4; i++) { -+ for (j = InterlacedOffset[i]; -+ j < sp->ImageDesc.Height; -+ j += InterlacedJumps[i]) { -+ if (DGifGetLine( -+ GifFile, -+ sp->RasterBits + -+ j * sp->ImageDesc -+ .Width, -+ sp->ImageDesc.Width) == -+ GIF_ERROR) { -+ DGifDecreaseImageCounter( -+ GifFile); -+ return GIF_ERROR; -+ } -+ } -+ } -+ } else { -+ if (DGifGetLine(GifFile, sp->RasterBits, -+ ImageSize) == GIF_ERROR) { -+ DGifDecreaseImageCounter(GifFile); -+ return GIF_ERROR; -+ } -+ } -+ -+ if (GifFile->ExtensionBlocks) { -+ sp->ExtensionBlocks = GifFile->ExtensionBlocks; -+ sp->ExtensionBlockCount = -+ GifFile->ExtensionBlockCount; -+ -+ GifFile->ExtensionBlocks = NULL; -+ GifFile->ExtensionBlockCount = 0; -+ } -+ break; -+ -+ case EXTENSION_RECORD_TYPE: -+ if (DGifGetExtension(GifFile, &ExtFunction, &ExtData) == -+ GIF_ERROR) { -+ return (GIF_ERROR); -+ } -+ /* Create an extension block with our data */ -+ if (ExtData != NULL) { -+ if (GifAddExtensionBlock( -+ &GifFile->ExtensionBlockCount, -+ &GifFile->ExtensionBlocks, ExtFunction, -+ ExtData[0], &ExtData[1]) == GIF_ERROR) { -+ return (GIF_ERROR); -+ } -+ } -+ for (;;) { -+ if (DGifGetExtensionNext(GifFile, &ExtData) == -+ GIF_ERROR) { -+ return (GIF_ERROR); -+ } -+ if (ExtData == NULL) { -+ break; -+ } -+ /* Continue the extension block */ -+ if (GifAddExtensionBlock( -+ &GifFile->ExtensionBlockCount, -+ &GifFile->ExtensionBlocks, -+ CONTINUE_EXT_FUNC_CODE, ExtData[0], -+ &ExtData[1]) == GIF_ERROR) { -+ return (GIF_ERROR); -+ } -+ } -+ break; -+ -+ case TERMINATE_RECORD_TYPE: -+ break; -+ -+ default: /* Should be trapped by DGifGetRecordType */ -+ break; - } - } while (RecordType != TERMINATE_RECORD_TYPE); - - /* Sanity check for corrupted file */ - if (GifFile->ImageCount == 0) { - GifFile->Error = D_GIF_ERR_NO_IMAG_DSCR; -- return(GIF_ERROR); -+ return (GIF_ERROR); - } - - return (GIF_OK); -diff --git a/jdk/src/share/native/sun/awt/giflib/gif_err.c b/jdk/src/share/native/sun/awt/giflib/gif_err.c -index db08838eff..3b6785f7c6 100644 ---- a/jdk/src/share/native/sun/awt/giflib/gif_err.c -+++ b/jdk/src/share/native/sun/awt/giflib/gif_err.c -@@ -38,82 +38,80 @@ SPDX-License-Identifier: MIT - /***************************************************************************** - Return a string description of the last GIF error - *****************************************************************************/ --const char * --GifErrorString(int ErrorCode) --{ -+const char *GifErrorString(int ErrorCode) { - const char *Err; - - switch (ErrorCode) { -- case E_GIF_ERR_OPEN_FAILED: -+ case E_GIF_ERR_OPEN_FAILED: - Err = "Failed to open given file"; - break; -- case E_GIF_ERR_WRITE_FAILED: -+ case E_GIF_ERR_WRITE_FAILED: - Err = "Failed to write to given file"; - break; -- case E_GIF_ERR_HAS_SCRN_DSCR: -+ case E_GIF_ERR_HAS_SCRN_DSCR: - Err = "Screen descriptor has already been set"; - break; -- case E_GIF_ERR_HAS_IMAG_DSCR: -+ case E_GIF_ERR_HAS_IMAG_DSCR: - Err = "Image descriptor is still active"; - break; -- case E_GIF_ERR_NO_COLOR_MAP: -+ case E_GIF_ERR_NO_COLOR_MAP: - Err = "Neither global nor local color map"; - break; -- case E_GIF_ERR_DATA_TOO_BIG: -+ case E_GIF_ERR_DATA_TOO_BIG: - Err = "Number of pixels bigger than width * height"; - break; -- case E_GIF_ERR_NOT_ENOUGH_MEM: -+ case E_GIF_ERR_NOT_ENOUGH_MEM: - Err = "Failed to allocate required memory"; - break; -- case E_GIF_ERR_DISK_IS_FULL: -+ case E_GIF_ERR_DISK_IS_FULL: - Err = "Write failed (disk full?)"; - break; -- case E_GIF_ERR_CLOSE_FAILED: -+ case E_GIF_ERR_CLOSE_FAILED: - Err = "Failed to close given file"; - break; -- case E_GIF_ERR_NOT_WRITEABLE: -+ case E_GIF_ERR_NOT_WRITEABLE: - Err = "Given file was not opened for write"; - break; -- case D_GIF_ERR_OPEN_FAILED: -+ case D_GIF_ERR_OPEN_FAILED: - Err = "Failed to open given file"; - break; -- case D_GIF_ERR_READ_FAILED: -+ case D_GIF_ERR_READ_FAILED: - Err = "Failed to read from given file"; - break; -- case D_GIF_ERR_NOT_GIF_FILE: -+ case D_GIF_ERR_NOT_GIF_FILE: - Err = "Data is not in GIF format"; - break; -- case D_GIF_ERR_NO_SCRN_DSCR: -+ case D_GIF_ERR_NO_SCRN_DSCR: - Err = "No screen descriptor detected"; - break; -- case D_GIF_ERR_NO_IMAG_DSCR: -+ case D_GIF_ERR_NO_IMAG_DSCR: - Err = "No Image Descriptor detected"; - break; -- case D_GIF_ERR_NO_COLOR_MAP: -+ case D_GIF_ERR_NO_COLOR_MAP: - Err = "Neither global nor local color map"; - break; -- case D_GIF_ERR_WRONG_RECORD: -+ case D_GIF_ERR_WRONG_RECORD: - Err = "Wrong record type detected"; - break; -- case D_GIF_ERR_DATA_TOO_BIG: -+ case D_GIF_ERR_DATA_TOO_BIG: - Err = "Number of pixels bigger than width * height"; - break; -- case D_GIF_ERR_NOT_ENOUGH_MEM: -+ case D_GIF_ERR_NOT_ENOUGH_MEM: - Err = "Failed to allocate required memory"; - break; -- case D_GIF_ERR_CLOSE_FAILED: -+ case D_GIF_ERR_CLOSE_FAILED: - Err = "Failed to close given file"; - break; -- case D_GIF_ERR_NOT_READABLE: -+ case D_GIF_ERR_NOT_READABLE: - Err = "Given file was not opened for read"; - break; -- case D_GIF_ERR_IMAGE_DEFECT: -+ case D_GIF_ERR_IMAGE_DEFECT: - Err = "Image is defective, decoding aborted"; - break; -- case D_GIF_ERR_EOF_TOO_SOON: -+ case D_GIF_ERR_EOF_TOO_SOON: - Err = "Image EOF detected before image complete"; - break; -- default: -+ default: - Err = NULL; - break; - } -diff --git a/jdk/src/share/native/sun/awt/giflib/gif_hash.h b/jdk/src/share/native/sun/awt/giflib/gif_hash.h -index 6cabd0866e..bd00af6416 100644 ---- a/jdk/src/share/native/sun/awt/giflib/gif_hash.h -+++ b/jdk/src/share/native/sun/awt/giflib/gif_hash.h -@@ -33,27 +33,25 @@ SPDX-License-Identifier: MIT - #ifndef _GIF_HASH_H_ - #define _GIF_HASH_H_ - --/** Begin JDK modifications to support building on Windows **/ - #ifndef _WIN32 - #include --#endif --/** End JDK modifications to support building on Windows **/ -+#endif /* _WIN32 */ - #include - --#define HT_SIZE 8192 /* 12bits = 4096 or twice as big! */ --#define HT_KEY_MASK 0x1FFF /* 13bits keys */ --#define HT_KEY_NUM_BITS 13 /* 13bits keys */ --#define HT_MAX_KEY 8191 /* 13bits - 1, maximal code possible */ --#define HT_MAX_CODE 4095 /* Biggest code possible in 12 bits. */ -+#define HT_SIZE 8192 /* 12bits = 4096 or twice as big! */ -+#define HT_KEY_MASK 0x1FFF /* 13bits keys */ -+#define HT_KEY_NUM_BITS 13 /* 13bits keys */ -+#define HT_MAX_KEY 8191 /* 13bits - 1, maximal code possible */ -+#define HT_MAX_CODE 4095 /* Biggest code possible in 12 bits. */ - - /* The 32 bits of the long are divided into two parts for the key & code: */ - /* 1. The code is 12 bits as our compression algorithm is limited to 12bits */ --/* 2. The key is 12 bits Prefix code + 8 bit new char or 20 bits. */ -+/* 2. The key is 12 bits Prefix code + 8 bit new char or 20 bits. */ - /* The key is the upper 20 bits. The code is the lower 12. */ --#define HT_GET_KEY(l) (l >> 12) --#define HT_GET_CODE(l) (l & 0x0FFF) --#define HT_PUT_KEY(l) (l << 12) --#define HT_PUT_CODE(l) (l & 0x0FFF) -+#define HT_GET_KEY(l) (l >> 12) -+#define HT_GET_CODE(l) (l & 0x0FFF) -+#define HT_PUT_KEY(l) (l << 12) -+#define HT_PUT_CODE(l) (l & 0x0FFF) - - typedef struct GifHashTableType { - uint32_t HTable[HT_SIZE]; -diff --git a/jdk/src/share/native/sun/awt/giflib/gif_lib.h b/jdk/src/share/native/sun/awt/giflib/gif_lib.h -index f739b36adf..716dc7e8ba 100644 ---- a/jdk/src/share/native/sun/awt/giflib/gif_lib.h -+++ b/jdk/src/share/native/sun/awt/giflib/gif_lib.h -@@ -39,27 +39,30 @@ extern "C" { - - #define GIFLIB_MAJOR 5 - #define GIFLIB_MINOR 2 --#define GIFLIB_RELEASE 1 -+#define GIFLIB_RELEASE 2 - --#define GIF_ERROR 0 --#define GIF_OK 1 -+#define GIF_ERROR 0 -+#define GIF_OK 1 - - #include - /** Begin JDK modifications to support building using old compilers**/ --//#include -+#ifndef _WIN32 -+#include -+#else - #ifdef bool - #undef bool - #endif - typedef int bool; - #define false 0 - #define true 1 -+#endif - /** End JDK modifications to support building using old compilers**/ - --#define GIF_STAMP "GIFVER" /* First chars in file - GIF stamp. */ -+#define GIF_STAMP "GIFVER" /* First chars in file - GIF stamp. */ - #define GIF_STAMP_LEN sizeof(GIF_STAMP) - 1 --#define GIF_VERSION_POS 3 /* Version first character in stamp. */ --#define GIF87_STAMP "GIF87a" /* First chars in file - GIF stamp. */ --#define GIF89_STAMP "GIF89a" /* First chars in file - GIF stamp. */ -+#define GIF_VERSION_POS 3 /* Version first character in stamp. */ -+#define GIF87_STAMP "GIF87a" /* First chars in file - GIF stamp. */ -+#define GIF89_STAMP "GIF89a" /* First chars in file - GIF stamp. */ - - typedef unsigned char GifPixelType; - typedef unsigned char *GifRowType; -@@ -75,24 +78,24 @@ typedef struct ColorMapObject { - int ColorCount; - int BitsPerPixel; - bool SortFlag; -- GifColorType *Colors; /* on malloc(3) heap */ -+ GifColorType *Colors; /* on malloc(3) heap */ - } ColorMapObject; - - typedef struct GifImageDesc { -- GifWord Left, Top, Width, Height; /* Current image dimensions. */ -- bool Interlace; /* Sequential/Interlaced lines. */ -- ColorMapObject *ColorMap; /* The local color map */ -+ GifWord Left, Top, Width, Height; /* Current image dimensions. */ -+ bool Interlace; /* Sequential/Interlaced lines. */ -+ ColorMapObject *ColorMap; /* The local color map */ - } GifImageDesc; - - typedef struct ExtensionBlock { - int ByteCount; -- GifByteType *Bytes; /* on malloc(3) heap */ -- int Function; /* The block function code */ --#define CONTINUE_EXT_FUNC_CODE 0x00 /* continuation subblock */ --#define COMMENT_EXT_FUNC_CODE 0xfe /* comment */ --#define GRAPHICS_EXT_FUNC_CODE 0xf9 /* graphics control (GIF89) */ --#define PLAINTEXT_EXT_FUNC_CODE 0x01 /* plaintext */ --#define APPLICATION_EXT_FUNC_CODE 0xff /* application block (GIF89) */ -+ GifByteType *Bytes; /* on malloc(3) heap */ -+ int Function; /* The block function code */ -+#define CONTINUE_EXT_FUNC_CODE 0x00 /* continuation subblock */ -+#define COMMENT_EXT_FUNC_CODE 0xfe /* comment */ -+#define GRAPHICS_EXT_FUNC_CODE 0xf9 /* graphics control (GIF89) */ -+#define PLAINTEXT_EXT_FUNC_CODE 0x01 /* plaintext */ -+#define APPLICATION_EXT_FUNC_CODE 0xff /* application block (GIF89) */ - } ExtensionBlock; - - typedef struct SavedImage { -@@ -103,22 +106,22 @@ typedef struct SavedImage { - } SavedImage; - - typedef struct GifFileType { -- GifWord SWidth, SHeight; /* Size of virtual canvas */ -- GifWord SColorResolution; /* How many colors can we generate? */ -- GifWord SBackGroundColor; /* Background color for virtual canvas */ -- GifByteType AspectByte; /* Used to compute pixel aspect ratio */ -- ColorMapObject *SColorMap; /* Global colormap, NULL if nonexistent. */ -- int ImageCount; /* Number of current image (both APIs) */ -- GifImageDesc Image; /* Current image (low-level API) */ -- SavedImage *SavedImages; /* Image sequence (high-level API) */ -- int ExtensionBlockCount; /* Count extensions past last image */ -+ GifWord SWidth, SHeight; /* Size of virtual canvas */ -+ GifWord SColorResolution; /* How many colors can we generate? */ -+ GifWord SBackGroundColor; /* Background color for virtual canvas */ -+ GifByteType AspectByte; /* Used to compute pixel aspect ratio */ -+ ColorMapObject *SColorMap; /* Global colormap, NULL if nonexistent. */ -+ int ImageCount; /* Number of current image (both APIs) */ -+ GifImageDesc Image; /* Current image (low-level API) */ -+ SavedImage *SavedImages; /* Image sequence (high-level API) */ -+ int ExtensionBlockCount; /* Count extensions past last image */ - ExtensionBlock *ExtensionBlocks; /* Extensions past last image */ - int Error; /* Last error condition reported */ - void *UserData; /* hook to attach user data (TVT) */ - void *Private; /* Don't mess with this! */ - } GifFileType; - --#define GIF_ASPECT_RATIO(n) ((n)+15.0/64.0) -+#define GIF_ASPECT_RATIO(n) ((n) + 15.0 / 64.0) - - typedef enum { - UNDEFINED_RECORD_TYPE, -@@ -129,12 +132,12 @@ typedef enum { - } GifRecordType; - - /* func type to read gif data from arbitrary sources (TVT) */ --typedef int (*InputFunc) (GifFileType *, GifByteType *, int); -+typedef int (*InputFunc)(GifFileType *, GifByteType *, int); - - /* func type to write gif data to arbitrary targets. - * Returns count of bytes written. (MRB) - */ --typedef int (*OutputFunc) (GifFileType *, const GifByteType *, int); -+typedef int (*OutputFunc)(GifFileType *, const GifByteType *, int); - - /****************************************************************************** - GIF89 structures -@@ -142,14 +145,14 @@ typedef int (*OutputFunc) (GifFileType *, const GifByteType *, int); - - typedef struct GraphicsControlBlock { - int DisposalMode; --#define DISPOSAL_UNSPECIFIED 0 /* No disposal specified. */ --#define DISPOSE_DO_NOT 1 /* Leave image in place */ --#define DISPOSE_BACKGROUND 2 /* Set area too background color */ --#define DISPOSE_PREVIOUS 3 /* Restore to previous content */ -- bool UserInputFlag; /* User confirmation required before disposal */ -- int DelayTime; /* pre-display delay in 0.01sec units */ -- int TransparentColor; /* Palette index for transparency, -1 if none */ --#define NO_TRANSPARENT_COLOR -1 -+#define DISPOSAL_UNSPECIFIED 0 /* No disposal specified. */ -+#define DISPOSE_DO_NOT 1 /* Leave image in place */ -+#define DISPOSE_BACKGROUND 2 /* Set area too background color */ -+#define DISPOSE_PREVIOUS 3 /* Restore to previous content */ -+ bool UserInputFlag; /* User confirmation required before disposal */ -+ int DelayTime; /* pre-display delay in 0.01sec units */ -+ int TransparentColor; /* Palette index for transparency, -1 if none */ -+#define NO_TRANSPARENT_COLOR -1 - } GraphicsControlBlock; - - /****************************************************************************** -@@ -161,49 +164,44 @@ GifFileType *EGifOpenFileName(const char *GifFileName, - const bool GifTestExistence, int *Error); - GifFileType *EGifOpenFileHandle(const int GifFileHandle, int *Error); - GifFileType *EGifOpen(void *userPtr, OutputFunc writeFunc, int *Error); --int EGifSpew(GifFileType * GifFile); -+int EGifSpew(GifFileType *GifFile); - const char *EGifGetGifVersion(GifFileType *GifFile); /* new in 5.x */ - int EGifCloseFile(GifFileType *GifFile, int *ErrorCode); - --#define E_GIF_SUCCEEDED 0 --#define E_GIF_ERR_OPEN_FAILED 1 /* And EGif possible errors. */ --#define E_GIF_ERR_WRITE_FAILED 2 --#define E_GIF_ERR_HAS_SCRN_DSCR 3 --#define E_GIF_ERR_HAS_IMAG_DSCR 4 --#define E_GIF_ERR_NO_COLOR_MAP 5 --#define E_GIF_ERR_DATA_TOO_BIG 6 -+#define E_GIF_SUCCEEDED 0 -+#define E_GIF_ERR_OPEN_FAILED 1 /* And EGif possible errors. */ -+#define E_GIF_ERR_WRITE_FAILED 2 -+#define E_GIF_ERR_HAS_SCRN_DSCR 3 -+#define E_GIF_ERR_HAS_IMAG_DSCR 4 -+#define E_GIF_ERR_NO_COLOR_MAP 5 -+#define E_GIF_ERR_DATA_TOO_BIG 6 - #define E_GIF_ERR_NOT_ENOUGH_MEM 7 --#define E_GIF_ERR_DISK_IS_FULL 8 --#define E_GIF_ERR_CLOSE_FAILED 9 --#define E_GIF_ERR_NOT_WRITEABLE 10 -+#define E_GIF_ERR_DISK_IS_FULL 8 -+#define E_GIF_ERR_CLOSE_FAILED 9 -+#define E_GIF_ERR_NOT_WRITEABLE 10 - - /* These are legacy. You probably do not want to call them directly */ --int EGifPutScreenDesc(GifFileType *GifFile, -- const int GifWidth, const int GifHeight, -- const int GifColorRes, -+int EGifPutScreenDesc(GifFileType *GifFile, const int GifWidth, -+ const int GifHeight, const int GifColorRes, - const int GifBackGround, - const ColorMapObject *GifColorMap); --int EGifPutImageDesc(GifFileType *GifFile, -- const int GifLeft, const int GifTop, -+int EGifPutImageDesc(GifFileType *GifFile, const int GifLeft, const int GifTop, - const int GifWidth, const int GifHeight, - const bool GifInterlace, - const ColorMapObject *GifColorMap); - void EGifSetGifVersion(GifFileType *GifFile, const bool gif89); --int EGifPutLine(GifFileType *GifFile, GifPixelType *GifLine, -- int GifLineLen); -+int EGifPutLine(GifFileType *GifFile, GifPixelType *GifLine, int GifLineLen); - int EGifPutPixel(GifFileType *GifFile, const GifPixelType GifPixel); - int EGifPutComment(GifFileType *GifFile, const char *GifComment); - int EGifPutExtensionLeader(GifFileType *GifFile, const int GifExtCode); --int EGifPutExtensionBlock(GifFileType *GifFile, -- const int GifExtLen, const void *GifExtension); -+int EGifPutExtensionBlock(GifFileType *GifFile, const int GifExtLen, -+ const void *GifExtension); - int EGifPutExtensionTrailer(GifFileType *GifFile); - int EGifPutExtension(GifFileType *GifFile, const int GifExtCode, -- const int GifExtLen, -- const void *GifExtension); -+ const int GifExtLen, const void *GifExtension); - int EGifPutCode(GifFileType *GifFile, int GifCodeSize, - const GifByteType *GifCodeBlock); --int EGifPutCodeNext(GifFileType *GifFile, -- const GifByteType *GifCodeBlock); -+int EGifPutCodeNext(GifFileType *GifFile, const GifByteType *GifCodeBlock); - - /****************************************************************************** - GIF decoding routines -@@ -212,24 +210,25 @@ int EGifPutCodeNext(GifFileType *GifFile, - /* Main entry points */ - GifFileType *DGifOpenFileName(const char *GifFileName, int *Error); - GifFileType *DGifOpenFileHandle(int GifFileHandle, int *Error); --int DGifSlurp(GifFileType * GifFile); --GifFileType *DGifOpen(void *userPtr, InputFunc readFunc, int *Error); /* new one (TVT) */ -- int DGifCloseFile(GifFileType * GifFile, int *ErrorCode); -- --#define D_GIF_SUCCEEDED 0 --#define D_GIF_ERR_OPEN_FAILED 101 /* And DGif possible errors. */ --#define D_GIF_ERR_READ_FAILED 102 --#define D_GIF_ERR_NOT_GIF_FILE 103 --#define D_GIF_ERR_NO_SCRN_DSCR 104 --#define D_GIF_ERR_NO_IMAG_DSCR 105 --#define D_GIF_ERR_NO_COLOR_MAP 106 --#define D_GIF_ERR_WRONG_RECORD 107 --#define D_GIF_ERR_DATA_TOO_BIG 108 -+int DGifSlurp(GifFileType *GifFile); -+GifFileType *DGifOpen(void *userPtr, InputFunc readFunc, -+ int *Error); /* new one (TVT) */ -+int DGifCloseFile(GifFileType *GifFile, int *ErrorCode); -+ -+#define D_GIF_SUCCEEDED 0 -+#define D_GIF_ERR_OPEN_FAILED 101 /* And DGif possible errors. */ -+#define D_GIF_ERR_READ_FAILED 102 -+#define D_GIF_ERR_NOT_GIF_FILE 103 -+#define D_GIF_ERR_NO_SCRN_DSCR 104 -+#define D_GIF_ERR_NO_IMAG_DSCR 105 -+#define D_GIF_ERR_NO_COLOR_MAP 106 -+#define D_GIF_ERR_WRONG_RECORD 107 -+#define D_GIF_ERR_DATA_TOO_BIG 108 - #define D_GIF_ERR_NOT_ENOUGH_MEM 109 --#define D_GIF_ERR_CLOSE_FAILED 110 --#define D_GIF_ERR_NOT_READABLE 111 --#define D_GIF_ERR_IMAGE_DEFECT 112 --#define D_GIF_ERR_EOF_TOO_SOON 113 -+#define D_GIF_ERR_CLOSE_FAILED 110 -+#define D_GIF_ERR_NOT_READABLE 111 -+#define D_GIF_ERR_IMAGE_DEFECT 112 -+#define D_GIF_ERR_EOF_TOO_SOON 113 - - /* These are legacy. You probably do not want to call them directly */ - int DGifGetScreenDesc(GifFileType *GifFile); -@@ -247,11 +246,10 @@ int DGifGetCodeNext(GifFileType *GifFile, GifByteType **GifCodeBlock); - int DGifGetLZCodes(GifFileType *GifFile, int *GifCode); - const char *DGifGetGifVersion(GifFileType *GifFile); - -- - /****************************************************************************** - Error handling and reporting. - ******************************************************************************/ --extern const char *GifErrorString(int ErrorCode); /* new in 2012 - ESR */ -+extern const char *GifErrorString(int ErrorCode); /* new in 2012 - ESR */ - - /***************************************************************************** - Everything below this point is new after version 1.2, supporting `slurp -@@ -263,26 +261,26 @@ extern const char *GifErrorString(int ErrorCode); /* new in 2012 - ESR */ - ******************************************************************************/ - - extern ColorMapObject *GifMakeMapObject(int ColorCount, -- const GifColorType *ColorMap); -+ const GifColorType *ColorMap); - extern void GifFreeMapObject(ColorMapObject *Object); - extern ColorMapObject *GifUnionColorMap(const ColorMapObject *ColorIn1, -- const ColorMapObject *ColorIn2, -- GifPixelType ColorTransIn2[]); -+ const ColorMapObject *ColorIn2, -+ GifPixelType ColorTransIn2[]); - extern int GifBitSize(int n); - - /****************************************************************************** - Support for the in-core structures allocation (slurp mode). - ******************************************************************************/ - --extern void GifApplyTranslation(SavedImage *Image, GifPixelType Translation[]); -+extern void GifApplyTranslation(SavedImage *Image, -+ const GifPixelType Translation[]); - extern int GifAddExtensionBlock(int *ExtensionBlock_Count, -- ExtensionBlock **ExtensionBlocks, -- int Function, -+ ExtensionBlock **ExtensionBlocks, int Function, - unsigned int Len, unsigned char ExtData[]); - extern void GifFreeExtensions(int *ExtensionBlock_Count, - ExtensionBlock **ExtensionBlocks); - extern SavedImage *GifMakeSavedImage(GifFileType *GifFile, -- const SavedImage *CopyFrom); -+ const SavedImage *CopyFrom); - extern void GifFreeSavedImages(GifFileType *GifFile); - - /****************************************************************************** -@@ -295,37 +293,31 @@ int DGifExtensionToGCB(const size_t GifExtensionLength, - size_t EGifGCBToExtension(const GraphicsControlBlock *GCB, - GifByteType *GifExtension); - --int DGifSavedExtensionToGCB(GifFileType *GifFile, -- int ImageIndex, -+int DGifSavedExtensionToGCB(GifFileType *GifFile, int ImageIndex, - GraphicsControlBlock *GCB); - int EGifGCBToSavedExtension(const GraphicsControlBlock *GCB, -- GifFileType *GifFile, -- int ImageIndex); -+ GifFileType *GifFile, int ImageIndex); - - /****************************************************************************** - The library's internal utility font - ******************************************************************************/ - --#define GIF_FONT_WIDTH 8 -+#define GIF_FONT_WIDTH 8 - #define GIF_FONT_HEIGHT 8 - extern const unsigned char GifAsciiTable8x8[][GIF_FONT_WIDTH]; - --extern void GifDrawText8x8(SavedImage *Image, -- const int x, const int y, -- const char *legend, const int color); -+extern void GifDrawText8x8(SavedImage *Image, const int x, const int y, -+ const char *legend, const int color); - --extern void GifDrawBox(SavedImage *Image, -- const int x, const int y, -- const int w, const int d, const int color); -+extern void GifDrawBox(SavedImage *Image, const int x, const int y, const int w, -+ const int d, const int color); - --extern void GifDrawRectangle(SavedImage *Image, -- const int x, const int y, -- const int w, const int d, const int color); -+extern void GifDrawRectangle(SavedImage *Image, const int x, const int y, -+ const int w, const int d, const int color); - --extern void GifDrawBoxedText8x8(SavedImage *Image, -- const int x, const int y, -- const char *legend, -- const int border, const int bg, const int fg); -+extern void GifDrawBoxedText8x8(SavedImage *Image, const int x, const int y, -+ const char *legend, const int border, -+ const int bg, const int fg); - - #ifdef __cplusplus - } -diff --git a/jdk/src/share/native/sun/awt/giflib/gif_lib_private.h b/jdk/src/share/native/sun/awt/giflib/gif_lib_private.h -index 4f832676ff..f905e0d7b4 100644 ---- a/jdk/src/share/native/sun/awt/giflib/gif_lib_private.h -+++ b/jdk/src/share/native/sun/awt/giflib/gif_lib_private.h -@@ -33,52 +33,54 @@ SPDX-License-Identifier: MIT - #ifndef _GIF_LIB_PRIVATE_H - #define _GIF_LIB_PRIVATE_H - --#include "gif_lib.h" - #include "gif_hash.h" -+#include "gif_lib.h" - - #ifndef SIZE_MAX -- #define SIZE_MAX UINTPTR_MAX -+#define SIZE_MAX UINTPTR_MAX - #endif - --#define EXTENSION_INTRODUCER 0x21 --#define DESCRIPTOR_INTRODUCER 0x2c --#define TERMINATOR_INTRODUCER 0x3b -+#define EXTENSION_INTRODUCER 0x21 -+#define DESCRIPTOR_INTRODUCER 0x2c -+#define TERMINATOR_INTRODUCER 0x3b - --#define LZ_MAX_CODE 4095 /* Biggest code possible in 12 bits. */ --#define LZ_BITS 12 -+#define LZ_MAX_CODE 4095 /* Biggest code possible in 12 bits. */ -+#define LZ_BITS 12 - --#define FLUSH_OUTPUT 4096 /* Impossible code, to signal flush. */ --#define FIRST_CODE 4097 /* Impossible code, to signal first. */ --#define NO_SUCH_CODE 4098 /* Impossible code, to signal empty. */ -+#define FLUSH_OUTPUT 4096 /* Impossible code, to signal flush. */ -+#define FIRST_CODE 4097 /* Impossible code, to signal first. */ -+#define NO_SUCH_CODE 4098 /* Impossible code, to signal empty. */ - --#define FILE_STATE_WRITE 0x01 --#define FILE_STATE_SCREEN 0x02 --#define FILE_STATE_IMAGE 0x04 --#define FILE_STATE_READ 0x08 -+#define FILE_STATE_WRITE 0x01 -+#define FILE_STATE_SCREEN 0x02 -+#define FILE_STATE_IMAGE 0x04 -+#define FILE_STATE_READ 0x08 - --#define IS_READABLE(Private) (Private->FileState & FILE_STATE_READ) --#define IS_WRITEABLE(Private) (Private->FileState & FILE_STATE_WRITE) -+#define IS_READABLE(Private) (Private->FileState & FILE_STATE_READ) -+#define IS_WRITEABLE(Private) (Private->FileState & FILE_STATE_WRITE) - - typedef struct GifFilePrivateType { -- GifWord FileState, FileHandle, /* Where all this data goes to! */ -- BitsPerPixel, /* Bits per pixel (Codes uses at least this + 1). */ -- ClearCode, /* The CLEAR LZ code. */ -- EOFCode, /* The EOF LZ code. */ -- RunningCode, /* The next code algorithm can generate. */ -- RunningBits, /* The number of bits required to represent RunningCode. */ -- MaxCode1, /* 1 bigger than max. possible code, in RunningBits bits. */ -- LastCode, /* The code before the current code. */ -- CrntCode, /* Current algorithm code. */ -- StackPtr, /* For character stack (see below). */ -- CrntShiftState; /* Number of bits in CrntShiftDWord. */ -- unsigned long CrntShiftDWord; /* For bytes decomposition into codes. */ -- unsigned long PixelCount; /* Number of pixels in image. */ -- FILE *File; /* File as stream. */ -- InputFunc Read; /* function to read gif input (TVT) */ -- OutputFunc Write; /* function to write gif output (MRB) */ -- GifByteType Buf[256]; /* Compressed input is buffered here. */ -+ GifWord FileState, FileHandle, /* Where all this data goes to! */ -+ BitsPerPixel, /* Bits per pixel (Codes uses at least this + 1). */ -+ ClearCode, /* The CLEAR LZ code. */ -+ EOFCode, /* The EOF LZ code. */ -+ RunningCode, /* The next code algorithm can generate. */ -+ RunningBits, /* The number of bits required to represent -+ RunningCode. */ -+ MaxCode1, /* 1 bigger than max. possible code, in RunningBits bits. -+ */ -+ LastCode, /* The code before the current code. */ -+ CrntCode, /* Current algorithm code. */ -+ StackPtr, /* For character stack (see below). */ -+ CrntShiftState; /* Number of bits in CrntShiftDWord. */ -+ unsigned long CrntShiftDWord; /* For bytes decomposition into codes. */ -+ unsigned long PixelCount; /* Number of pixels in image. */ -+ FILE *File; /* File as stream. */ -+ InputFunc Read; /* function to read gif input (TVT) */ -+ OutputFunc Write; /* function to write gif output (MRB) */ -+ GifByteType Buf[256]; /* Compressed input is buffered here. */ - GifByteType Stack[LZ_MAX_CODE]; /* Decoded pixels are stacked here. */ -- GifByteType Suffix[LZ_MAX_CODE + 1]; /* So we can trace the codes. */ -+ GifByteType Suffix[LZ_MAX_CODE + 1]; /* So we can trace the codes. */ - GifPrefixType Prefix[LZ_MAX_CODE + 1]; - GifHashTableType *HashTable; - bool gif89; -diff --git a/jdk/src/share/native/sun/awt/giflib/gifalloc.c b/jdk/src/share/native/sun/awt/giflib/gifalloc.c -index 75b74b4fba..5aef304455 100644 ---- a/jdk/src/share/native/sun/awt/giflib/gifalloc.c -+++ b/jdk/src/share/native/sun/awt/giflib/gifalloc.c -@@ -30,59 +30,59 @@ SPDX-License-Identifier: MIT - - ****************************************************************************/ - --#include - #include -+#include - #include - - #include "gif_lib.h" - #include "gif_lib_private.h" - --#define MAX(x, y) (((x) > (y)) ? (x) : (y)) -+#define MAX(x, y) (((x) > (y)) ? (x) : (y)) - - /****************************************************************************** - Miscellaneous utility functions - ******************************************************************************/ - - /* return smallest bitfield size n will fit in */ --int --GifBitSize(int n) --{ -+int GifBitSize(int n) { - register int i; - -- for (i = 1; i <= 8; i++) -- if ((1 << i) >= n) -+ for (i = 1; i <= 8; i++) { -+ if ((1 << i) >= n) { - break; -+ } -+ } - return (i); - } - - /****************************************************************************** -- Color map object functions -+ Color map object functions - ******************************************************************************/ - - /* - * Allocate a color map of given size; initialize with contents of - * ColorMap if that pointer is non-NULL. - */ --ColorMapObject * --GifMakeMapObject(int ColorCount, const GifColorType *ColorMap) --{ -+ColorMapObject *GifMakeMapObject(int ColorCount, const GifColorType *ColorMap) { - ColorMapObject *Object; - - /*** FIXME: Our ColorCount has to be a power of two. Is it necessary to -- * make the user know that or should we automatically round up instead? */ -+ * make the user know that or should we automatically round up instead? -+ */ - if (ColorCount != (1 << GifBitSize(ColorCount))) { -- return ((ColorMapObject *) NULL); -+ return ((ColorMapObject *)NULL); - } - - Object = (ColorMapObject *)malloc(sizeof(ColorMapObject)); -- if (Object == (ColorMapObject *) NULL) { -- return ((ColorMapObject *) NULL); -+ if (Object == (ColorMapObject *)NULL) { -+ return ((ColorMapObject *)NULL); - } - -- Object->Colors = (GifColorType *)calloc(ColorCount, sizeof(GifColorType)); -- if (Object->Colors == (GifColorType *) NULL) { -+ Object->Colors = -+ (GifColorType *)calloc(ColorCount, sizeof(GifColorType)); -+ if (Object->Colors == (GifColorType *)NULL) { - free(Object); -- return ((ColorMapObject *) NULL); -+ return ((ColorMapObject *)NULL); - } - - Object->ColorCount = ColorCount; -@@ -90,19 +90,17 @@ GifMakeMapObject(int ColorCount, const GifColorType *ColorMap) - Object->SortFlag = false; - - if (ColorMap != NULL) { -- memcpy((char *)Object->Colors, -- (char *)ColorMap, ColorCount * sizeof(GifColorType)); -+ memcpy((char *)Object->Colors, (char *)ColorMap, -+ ColorCount * sizeof(GifColorType)); - } - - return (Object); - } - - /******************************************************************************* --Free a color map object -+ Free a color map object - *******************************************************************************/ --void --GifFreeMapObject(ColorMapObject *Object) --{ -+void GifFreeMapObject(ColorMapObject *Object) { - if (Object != NULL) { - (void)free(Object->Colors); - (void)free(Object); -@@ -110,17 +108,14 @@ GifFreeMapObject(ColorMapObject *Object) - } - - #ifdef DEBUG --void --DumpColorMap(ColorMapObject *Object, -- FILE * fp) --{ -+void DumpColorMap(ColorMapObject *Object, FILE *fp) { - if (Object != NULL) { - int i, j, Len = Object->ColorCount; - - for (i = 0; i < Len; i += 4) { - for (j = 0; j < 4 && j < Len; j++) { -- (void)fprintf(fp, "%3d: %02x %02x %02x ", i + j, -- Object->Colors[i + j].Red, -+ (void)fprintf(fp, "%3d: %02x %02x %02x ", -+ i + j, Object->Colors[i + j].Red, - Object->Colors[i + j].Green, - Object->Colors[i + j].Blue); - } -@@ -137,11 +132,9 @@ DumpColorMap(ColorMapObject *Object, - copied iff they didn't exist before. ColorTransIn2 maps the old - ColorIn2 into the ColorUnion color map table./ - *******************************************************************************/ --ColorMapObject * --GifUnionColorMap(const ColorMapObject *ColorIn1, -- const ColorMapObject *ColorIn2, -- GifPixelType ColorTransIn2[]) --{ -+ColorMapObject *GifUnionColorMap(const ColorMapObject *ColorIn1, -+ const ColorMapObject *ColorIn2, -+ GifPixelType ColorTransIn2[]) { - int i, j, CrntSlot, RoundUpTo, NewGifBitSize; - ColorMapObject *ColorUnion; - -@@ -152,17 +145,19 @@ GifUnionColorMap(const ColorMapObject *ColorIn1, - */ - - /* Allocate table which will hold the result for sure. */ -- ColorUnion = GifMakeMapObject(MAX(ColorIn1->ColorCount, -- ColorIn2->ColorCount) * 2, NULL); -+ ColorUnion = GifMakeMapObject( -+ MAX(ColorIn1->ColorCount, ColorIn2->ColorCount) * 2, NULL); - -- if (ColorUnion == NULL) -+ if (ColorUnion == NULL) { - return (NULL); -+ } - - /* - * Copy ColorIn1 to ColorUnion. - */ -- for (i = 0; i < ColorIn1->ColorCount; i++) -+ for (i = 0; i < ColorIn1->ColorCount; i++) { - ColorUnion->Colors[i] = ColorIn1->Colors[i]; -+ } - CrntSlot = ColorIn1->ColorCount; - - /* -@@ -172,22 +167,25 @@ GifUnionColorMap(const ColorMapObject *ColorIn1, - * of table 1. This is very useful if your display is limited to - * 16 colors. - */ -- while (ColorIn1->Colors[CrntSlot - 1].Red == 0 -- && ColorIn1->Colors[CrntSlot - 1].Green == 0 -- && ColorIn1->Colors[CrntSlot - 1].Blue == 0) -+ while (ColorIn1->Colors[CrntSlot - 1].Red == 0 && -+ ColorIn1->Colors[CrntSlot - 1].Green == 0 && -+ ColorIn1->Colors[CrntSlot - 1].Blue == 0) { - CrntSlot--; -+ } - - /* Copy ColorIn2 to ColorUnion (use old colors if they exist): */ - for (i = 0; i < ColorIn2->ColorCount && CrntSlot <= 256; i++) { - /* Let's see if this color already exists: */ -- for (j = 0; j < ColorIn1->ColorCount; j++) -- if (memcmp (&ColorIn1->Colors[j], &ColorIn2->Colors[i], -- sizeof(GifColorType)) == 0) -+ for (j = 0; j < ColorIn1->ColorCount; j++) { -+ if (memcmp(&ColorIn1->Colors[j], &ColorIn2->Colors[i], -+ sizeof(GifColorType)) == 0) { - break; -+ } -+ } - -- if (j < ColorIn1->ColorCount) -- ColorTransIn2[i] = j; /* color exists in Color1 */ -- else { -+ if (j < ColorIn1->ColorCount) { -+ ColorTransIn2[i] = j; /* color exists in Color1 */ -+ } else { - /* Color is new - copy it to a new slot: */ - ColorUnion->Colors[CrntSlot] = ColorIn2->Colors[i]; - ColorTransIn2[i] = CrntSlot++; -@@ -196,7 +194,7 @@ GifUnionColorMap(const ColorMapObject *ColorIn1, - - if (CrntSlot > 256) { - GifFreeMapObject(ColorUnion); -- return ((ColorMapObject *) NULL); -+ return ((ColorMapObject *)NULL); - } - - NewGifBitSize = GifBitSize(CrntSlot); -@@ -210,16 +208,17 @@ GifUnionColorMap(const ColorMapObject *ColorIn1, - * We know these slots exist because of the way ColorUnion's - * start dimension was computed. - */ -- for (j = CrntSlot; j < RoundUpTo; j++) -+ for (j = CrntSlot; j < RoundUpTo; j++) { - Map[j].Red = Map[j].Green = Map[j].Blue = 0; -+ } - - /* perhaps we can shrink the map? */ - if (RoundUpTo < ColorUnion->ColorCount) { -- GifColorType *new_map = (GifColorType *)reallocarray(Map, -- RoundUpTo, sizeof(GifColorType)); -- if( new_map == NULL ) { -+ GifColorType *new_map = (GifColorType *)reallocarray( -+ Map, RoundUpTo, sizeof(GifColorType)); -+ if (new_map == NULL) { - GifFreeMapObject(ColorUnion); -- return ((ColorMapObject *) NULL); -+ return ((ColorMapObject *)NULL); - } - ColorUnion->Colors = new_map; - } -@@ -234,49 +233,49 @@ GifUnionColorMap(const ColorMapObject *ColorIn1, - /******************************************************************************* - Apply a given color translation to the raster bits of an image - *******************************************************************************/ --void --GifApplyTranslation(SavedImage *Image, GifPixelType Translation[]) --{ -+void GifApplyTranslation(SavedImage *Image, const GifPixelType Translation[]) { - register int i; -- register int RasterSize = Image->ImageDesc.Height * Image->ImageDesc.Width; -+ register int RasterSize = -+ Image->ImageDesc.Height * Image->ImageDesc.Width; - -- for (i = 0; i < RasterSize; i++) -+ for (i = 0; i < RasterSize; i++) { - Image->RasterBits[i] = Translation[Image->RasterBits[i]]; -+ } - } - - /****************************************************************************** - Extension record functions - ******************************************************************************/ --int --GifAddExtensionBlock(int *ExtensionBlockCount, -- ExtensionBlock **ExtensionBlocks, -- int Function, -- unsigned int Len, -- unsigned char ExtData[]) --{ -+int GifAddExtensionBlock(int *ExtensionBlockCount, -+ ExtensionBlock **ExtensionBlocks, int Function, -+ unsigned int Len, unsigned char ExtData[]) { - ExtensionBlock *ep; - -- if (*ExtensionBlocks == NULL) -- *ExtensionBlocks=(ExtensionBlock *)malloc(sizeof(ExtensionBlock)); -- else { -- ExtensionBlock* ep_new = (ExtensionBlock *)reallocarray -- (*ExtensionBlocks, (*ExtensionBlockCount + 1), -- sizeof(ExtensionBlock)); -- if( ep_new == NULL ) -+ if (*ExtensionBlocks == NULL) { -+ *ExtensionBlocks = -+ (ExtensionBlock *)malloc(sizeof(ExtensionBlock)); -+ } else { -+ ExtensionBlock *ep_new = (ExtensionBlock *)reallocarray( -+ *ExtensionBlocks, (*ExtensionBlockCount + 1), -+ sizeof(ExtensionBlock)); -+ if (ep_new == NULL) { - return (GIF_ERROR); -+ } - *ExtensionBlocks = ep_new; - } - -- if (*ExtensionBlocks == NULL) -+ if (*ExtensionBlocks == NULL) { - return (GIF_ERROR); -+ } - - ep = &(*ExtensionBlocks)[(*ExtensionBlockCount)++]; - - ep->Function = Function; -- ep->ByteCount=Len; -+ ep->ByteCount = Len; - ep->Bytes = (GifByteType *)malloc(ep->ByteCount); -- if (ep->Bytes == NULL) -+ if (ep->Bytes == NULL) { - return (GIF_ERROR); -+ } - - if (ExtData != NULL) { - memcpy(ep->Bytes, ExtData, Len); -@@ -285,38 +284,36 @@ GifAddExtensionBlock(int *ExtensionBlockCount, - return (GIF_OK); - } - --void --GifFreeExtensions(int *ExtensionBlockCount, -- ExtensionBlock **ExtensionBlocks) --{ -+void GifFreeExtensions(int *ExtensionBlockCount, -+ ExtensionBlock **ExtensionBlocks) { - ExtensionBlock *ep; - -- if (*ExtensionBlocks == NULL) -+ if (*ExtensionBlocks == NULL) { - return; -+ } - - for (ep = *ExtensionBlocks; -- ep < (*ExtensionBlocks + *ExtensionBlockCount); -- ep++) -+ ep < (*ExtensionBlocks + *ExtensionBlockCount); ep++) { - (void)free((char *)ep->Bytes); -+ } - (void)free((char *)*ExtensionBlocks); - *ExtensionBlocks = NULL; - *ExtensionBlockCount = 0; - } - - /****************************************************************************** -- Image block allocation functions -+ Image block allocation functions - ******************************************************************************/ - - /* Private Function: - * Frees the last image in the GifFile->SavedImages array - */ --void --FreeLastSavedImage(GifFileType *GifFile) --{ -+void FreeLastSavedImage(GifFileType *GifFile) { - SavedImage *sp; - -- if ((GifFile == NULL) || (GifFile->SavedImages == NULL)) -+ if ((GifFile == NULL) || (GifFile->SavedImages == NULL)) { - return; -+ } - - /* Remove one SavedImage from the GifFile */ - GifFile->ImageCount--; -@@ -329,54 +326,58 @@ FreeLastSavedImage(GifFileType *GifFile) - } - - /* Deallocate the image data */ -- if (sp->RasterBits != NULL) -+ if (sp->RasterBits != NULL) { - free((char *)sp->RasterBits); -+ } - - /* Deallocate any extensions */ - GifFreeExtensions(&sp->ExtensionBlockCount, &sp->ExtensionBlocks); - - /*** FIXME: We could realloc the GifFile->SavedImages structure but is - * there a point to it? Saves some memory but we'd have to do it every -- * time. If this is used in GifFreeSavedImages then it would be inefficient -- * (The whole array is going to be deallocated.) If we just use it when -- * we want to free the last Image it's convenient to do it here. -+ * time. If this is used in GifFreeSavedImages then it would be -+ * inefficient (The whole array is going to be deallocated.) If we just -+ * use it when we want to free the last Image it's convenient to do it -+ * here. - */ - } - - /* - * Append an image block to the SavedImages array - */ --SavedImage * --GifMakeSavedImage(GifFileType *GifFile, const SavedImage *CopyFrom) --{ -- if (GifFile->SavedImages == NULL) -+SavedImage *GifMakeSavedImage(GifFileType *GifFile, -+ const SavedImage *CopyFrom) { -+ // cppcheck-suppress ctunullpointer -+ if (GifFile->SavedImages == NULL) { - GifFile->SavedImages = (SavedImage *)malloc(sizeof(SavedImage)); -- else { -- SavedImage* newSavedImages = (SavedImage *)reallocarray(GifFile->SavedImages, -- (GifFile->ImageCount + 1), sizeof(SavedImage)); -- if( newSavedImages == NULL) -+ } else { -+ SavedImage *newSavedImages = (SavedImage *)reallocarray( -+ GifFile->SavedImages, (GifFile->ImageCount + 1), -+ sizeof(SavedImage)); -+ if (newSavedImages == NULL) { - return ((SavedImage *)NULL); -+ } - GifFile->SavedImages = newSavedImages; - } -- if (GifFile->SavedImages == NULL) -+ if (GifFile->SavedImages == NULL) { - return ((SavedImage *)NULL); -- else { -+ } else { - SavedImage *sp = &GifFile->SavedImages[GifFile->ImageCount++]; - - if (CopyFrom != NULL) { - memcpy((char *)sp, CopyFrom, sizeof(SavedImage)); - - /* -- * Make our own allocated copies of the heap fields in the -- * copied record. This guards against potential aliasing -- * problems. -+ * Make our own allocated copies of the heap fields in -+ * the copied record. This guards against potential -+ * aliasing problems. - */ - - /* first, the local color map */ - if (CopyFrom->ImageDesc.ColorMap != NULL) { - sp->ImageDesc.ColorMap = GifMakeMapObject( -- CopyFrom->ImageDesc.ColorMap->ColorCount, -- CopyFrom->ImageDesc.ColorMap->Colors); -+ CopyFrom->ImageDesc.ColorMap->ColorCount, -+ CopyFrom->ImageDesc.ColorMap->Colors); - if (sp->ImageDesc.ColorMap == NULL) { - FreeLastSavedImage(GifFile); - return (SavedImage *)(NULL); -@@ -384,32 +385,36 @@ GifMakeSavedImage(GifFileType *GifFile, const SavedImage *CopyFrom) - } - - /* next, the raster */ -- sp->RasterBits = (unsigned char *)reallocarray(NULL, -- (CopyFrom->ImageDesc.Height * -- CopyFrom->ImageDesc.Width), -- sizeof(GifPixelType)); -+ sp->RasterBits = (unsigned char *)reallocarray( -+ NULL, -+ (CopyFrom->ImageDesc.Height * -+ CopyFrom->ImageDesc.Width), -+ sizeof(GifPixelType)); - if (sp->RasterBits == NULL) { - FreeLastSavedImage(GifFile); - return (SavedImage *)(NULL); - } - memcpy(sp->RasterBits, CopyFrom->RasterBits, -- sizeof(GifPixelType) * CopyFrom->ImageDesc.Height * -- CopyFrom->ImageDesc.Width); -+ sizeof(GifPixelType) * -+ CopyFrom->ImageDesc.Height * -+ CopyFrom->ImageDesc.Width); - - /* finally, the extension blocks */ - if (CopyFrom->ExtensionBlocks != NULL) { -- sp->ExtensionBlocks = (ExtensionBlock *)reallocarray(NULL, -- CopyFrom->ExtensionBlockCount, -- sizeof(ExtensionBlock)); -+ sp->ExtensionBlocks = -+ (ExtensionBlock *)reallocarray( -+ NULL, CopyFrom->ExtensionBlockCount, -+ sizeof(ExtensionBlock)); - if (sp->ExtensionBlocks == NULL) { - FreeLastSavedImage(GifFile); - return (SavedImage *)(NULL); - } -- memcpy(sp->ExtensionBlocks, CopyFrom->ExtensionBlocks, -- sizeof(ExtensionBlock) * CopyFrom->ExtensionBlockCount); -+ memcpy(sp->ExtensionBlocks, -+ CopyFrom->ExtensionBlocks, -+ sizeof(ExtensionBlock) * -+ CopyFrom->ExtensionBlockCount); - } -- } -- else { -+ } else { - memset((char *)sp, '\0', sizeof(SavedImage)); - } - -@@ -417,9 +422,7 @@ GifMakeSavedImage(GifFileType *GifFile, const SavedImage *CopyFrom) - } - } - --void --GifFreeSavedImages(GifFileType *GifFile) --{ -+void GifFreeSavedImages(GifFileType *GifFile) { - SavedImage *sp; - - if ((GifFile == NULL) || (GifFile->SavedImages == NULL)) { -@@ -432,10 +435,12 @@ GifFreeSavedImages(GifFileType *GifFile) - sp->ImageDesc.ColorMap = NULL; - } - -- if (sp->RasterBits != NULL) -+ if (sp->RasterBits != NULL) { - free((char *)sp->RasterBits); -+ } - -- GifFreeExtensions(&sp->ExtensionBlockCount, &sp->ExtensionBlocks); -+ GifFreeExtensions(&sp->ExtensionBlockCount, -+ &sp->ExtensionBlocks); - } - free((char *)GifFile->SavedImages); - GifFile->SavedImages = NULL; -diff --git a/jdk/src/share/native/sun/awt/giflib/openbsd-reallocarray.c b/jdk/src/share/native/sun/awt/giflib/openbsd-reallocarray.c -index 452df69d7c..7420af674c 100644 ---- a/jdk/src/share/native/sun/awt/giflib/openbsd-reallocarray.c -+++ b/jdk/src/share/native/sun/awt/giflib/openbsd-reallocarray.c -@@ -28,24 +28,22 @@ - * SPDX-License-Identifier: MIT - */ - --#include - #include - #include - #include -+#include - - #ifndef SIZE_MAX -- #define SIZE_MAX UINTPTR_MAX -+#define SIZE_MAX UINTPTR_MAX - #endif - - /* - * This is sqrt(SIZE_MAX+1), as s1*s2 <= SIZE_MAX - * if both s1 < MUL_NO_OVERFLOW and s2 < MUL_NO_OVERFLOW - */ --#define MUL_NO_OVERFLOW ((size_t)1 << (sizeof(size_t) * 4)) -+#define MUL_NO_OVERFLOW ((size_t)1 << (sizeof(size_t) * 4)) - --void * --openbsd_reallocarray(void *optr, size_t nmemb, size_t size) --{ -+void *openbsd_reallocarray(void *optr, size_t nmemb, size_t size) { - if ((nmemb >= MUL_NO_OVERFLOW || size >= MUL_NO_OVERFLOW) && - nmemb > 0 && SIZE_MAX / nmemb < size) { - errno = ENOMEM; -@@ -93,7 +91,8 @@ openbsd_reallocarray(void *optr, size_t nmemb, size_t size) - * fuzzing on one platform may not detect zero-size allocation - * problems on other platforms. - */ -- if (size == 0 || nmemb == 0) -+ if (size == 0 || nmemb == 0) { - return NULL; -+ } - return realloc(optr, size * nmemb); - } diff --git a/SOURCES/jdk8385876-zero_this_pointer_is_null.patch b/SOURCES/jdk8385876-zero_this_pointer_is_null.patch new file mode 100644 index 0000000..84bf5ef --- /dev/null +++ b/SOURCES/jdk8385876-zero_this_pointer_is_null.patch @@ -0,0 +1,28 @@ +diff --git a/hotspot/src/share/vm/code/compiledIC.cpp b/hotspot/src/share/vm/code/compiledIC.cpp +index 63821c0613..b0e3d057ca 100644 +--- a/hotspot/src/share/vm/code/compiledIC.cpp ++++ b/hotspot/src/share/vm/code/compiledIC.cpp +@@ -403,7 +403,8 @@ void CompiledIC::set_to_monomorphic(CompiledICInfo& info) { + assert(info.cached_metadata() != NULL && info.cached_metadata()->is_method(), "sanity check"); + CompiledStaticCall* csc = compiledStaticCall_at(instruction_address()); + methodHandle method (thread, (Method*)info.cached_metadata()); +- csc->set_to_interpreted(method, info.entry()); ++ // Compiler sees 'this' as null on Zero but it should never actually get called ++ NOT_ZERO(csc->set_to_interpreted(method, info.entry())); + if (TraceICs) { + ResourceMark rm(thread); + tty->print_cr ("IC@" INTPTR_FORMAT ": monomorphic to interpreter: %s", +diff --git a/hotspot/src/share/vm/runtime/sharedRuntime.cpp b/hotspot/src/share/vm/runtime/sharedRuntime.cpp +index a136da9054..39fb84628b 100644 +--- a/hotspot/src/share/vm/runtime/sharedRuntime.cpp ++++ b/hotspot/src/share/vm/runtime/sharedRuntime.cpp +@@ -1319,7 +1319,8 @@ methodHandle SharedRuntime::resolve_sub_helper(JavaThread *thread, + } + } else { + CompiledStaticCall* ssc = compiledStaticCall_before(caller_frame.pc()); +- if (ssc->is_clean()) ssc->set(static_call_info); ++ // Compiler sees 'this' as null on Zero but it should never actually get called ++ NOT_ZERO(if (ssc->is_clean()) ssc->set(static_call_info)); + } + } + diff --git a/SPECS/java-1.8.0-openjdk.spec b/SPECS/java-1.8.0-openjdk.spec index ba6ee6f..d71c11e 100644 --- a/SPECS/java-1.8.0-openjdk.spec +++ b/SPECS/java-1.8.0-openjdk.spec @@ -3,6 +3,105 @@ # it and then adjust portablerelease and portablesuffix # to match the new portable. +# New Version-String scheme-style defines +%global majorver 8 +# Define version of OpenJDK 8 used +%global project openjdk +%global repo shenandoah-jdk8u +%global openjdk_revision 8u504-b01 +%global shenandoah_revision shenandoah%{openjdk_revision} +# e.g. aarch64-shenandoah-jdk8u212-b04-shenandoah-merge-2019-04-30 -> aarch64-shenandoah-jdk8u212-b04 +%global version_tag %(VERSION=%{shenandoah_revision}; echo ${VERSION%%-shenandoah-merge*}) +# eg # jdk8u60-b27 -> jdk8u60 or # aarch64-jdk8u60-b27 -> aarch64-jdk8u60 (dont forget spec escape % by %%) +%global whole_update %(VERSION=%{version_tag}; echo ${VERSION%%-*}) +# eg jdk8u60 -> 60 or aarch64-jdk8u60 -> 60 +%global updatever %(VERSION=%{whole_update}; echo ${VERSION##*u}) +# eg jdk8u60-b27 -> b27 +%global buildver %(VERSION=%{version_tag}; echo ${VERSION##*-}) +%global portablerelease 2 +%global rpmrelease 1 + +# Define IcedTea version used for SystemTap tapsets and desktop files +%global icedteaver 3.15.0 +# Define current Git revision for the FIPS support patches +%global fipsver 6d1aade0648 +# Define current Git revision for the cacerts patch +%global cacertsver 8139f2361c2 +%global javaver 1.%{majorver}.0 + +# Standard JPackage naming and versioning defines +%global origin openjdk +%global origin_nice OpenJDK +%global top_level_dir_name %{shenandoah_revision} + +# Define milestone (EA for pre-releases, GA ("fcs") for releases) +# Release will be (where N is usually a number starting at 1): +# - 0.N.ea for EA releases, +# - N for GA releases +%global is_ga 1 +%if %{is_ga} +%global milestone fcs +%global milestone_version %{nil} +%global extraver %{nil} +%global eaprefix %{nil} +%else +%global milestone ea +%global milestone_version "-ea" +%global extraver .%{milestone} +%global eaprefix 0. +%endif + +%global compatiblename java-%{javaver}-%{origin} + +Name: %{compatiblename} +Version: %{javaver}.%{updatever}.%{buildver} +Release: %{?eaprefix}%{portablerelease}.%{rpmrelease}%{?extraver}%{?dist}.alma.1 + +%global fullversion %{compatiblename}-%{version}-%{release} + +# java-1.5.0-ibm from jpackage.org set Epoch to 1 for unknown reasons +# and this change was brought into RHEL-4. java-1.5.0-ibm packages +# also included the epoch in their virtual provides. This created a +# situation where in-the-wild java-1.5.0-ibm packages provided "java = +# 1:1.5.0". In RPM terms, "1.6.0 < 1:1.5.0" since 1.6.0 is +# interpreted as 0:1.6.0. So the "java >= 1.6.0" requirement would be +# satisfied by the 1:1.5.0 packages. Thus we need to set the epoch in +# JDK package >= 1.6.0 to 1, and packages referring to JDK virtual +# provides >= 1.6.0 must specify the epoch, "java >= 1:1.6.0". + +Epoch: 1 +Summary: %{origin_nice} %{majorver} Runtime Environment + +# HotSpot code is licensed under GPLv2 +# JDK library code is licensed under GPLv2 with the Classpath exception +# The Apache license is used in code taken from Apache projects (primarily JAXP & JAXWS) +# DOM levels 2 & 3 and the XML digital signature schemas are licensed under the W3C Software License +# The JSR166 concurrency code is in the public domain +# The BSD and MIT licenses are used for a number of third-party libraries (see THIRD_PARTY_README) +# The OpenJDK source tree includes the JPEG library (IJG), zlib & libpng (zlib), giflib and LCMS (MIT) +# The test code includes copies of NSS under the Mozilla Public License v2.0 +# The PCSClite headers are under a BSD with advertising license +# The elliptic curve cryptography (ECC) source code is licensed under the LGPLv2.1 or any later version +License: ASL 1.1 and ASL 2.0 and BSD and BSD with advertising and GPL+ and GPLv2 and GPLv2 with exceptions and IJG and LGPLv2+ and MIT and MPLv2.0 and Public Domain and W3C and zlib +URL: http://openjdk.java.net/ + +# Settings used by the portable build +# Release field for the portable build +# The rpmrelease field is always zero for portables +%global prelease %{?eaprefix}%{portablerelease}.0%{?extraver} +# Portable suffix differs between RHEL and CentOS +%if 0%{?centos} == 0 +%global portablerhel 8 +%else +%global portablerhel 8 +%endif + +%if 0%{?almalinux} +%global portablerhel 8 +%endif +%global portablebuilddir /builddir/build/BUILD +%global portablesuffix el%{portablerhel} + # RPM conditionals so as to be able to dynamically produce # slowdebug/release builds. See: # http://rpm.org/user_doc/conditional_builds.html @@ -101,7 +200,7 @@ # rpm -ql --noghost java-11-openjdk-headless-11.0.1.13-8.fc29.x86_64.rpm | grep bin # == rpm -ql java-11-openjdk-headless-slowdebug-11.0.1.13-8.fc29.x86_64.rpm | grep bin # != rpm -ql java-11-openjdk-headless-11.0.1.13-8.fc29.x86_64.rpm | grep bin -# similarly for other %%{_jvmdir}/{jre,java} and %%{_javadocdir}/{java,java-zip} +# similarly for other <_jvmdir>/{jre,java} and <_javadocdir>/{java,java-zip} %define is_release_build() %( if [ "%{?1}" == "%{debug_suffix_unquoted}" -o "%{?1}" == "%{fastdebug_suffix_unquoted}" ]; then echo "0" ; else echo "1"; fi ) # Indicates whether this is the default JDK on this version of RHEL @@ -111,6 +210,9 @@ # we need to distinguish between big and little endian PPC64 %global ppc64le ppc64le %global ppc64be ppc64 ppc64p7 + +# Define the architectures on which we build +ExclusiveArch: %{aarch64} %{ix86} %{ppc64le} s390x x86_64 # Set of architectures which support multiple ABIs %global multilib_arches %{power64} sparc64 x86_64 # Set of architectures for which we build slowdebug builds @@ -301,33 +403,12 @@ %global stapinstall %{nil} %endif - - %ifarch %{systemtap_arches} %global with_systemtap 1 %else %global with_systemtap 0 %endif -# New Version-String scheme-style defines -%global majorver 8 -# Define version of OpenJDK 8 used -%global project openjdk -%global repo shenandoah-jdk8u -%global openjdk_revision 8u482-b08 -%global shenandoah_revision shenandoah%{openjdk_revision} -# Define IcedTea version used for SystemTap tapsets and desktop files -%global icedteaver 3.15.0 -# Define current Git revision for the FIPS support patches -%global fipsver 6d1aade0648 -# Define current Git revision for the cacerts patch -%global cacertsver 8139f2361c2 - -# Standard JPackage naming and versioning defines -%global origin openjdk -%global origin_nice OpenJDK -%global top_level_dir_name %{shenandoah_revision} - # Settings for local security configuration %global security_file %{top_level_dir_name}/jdk/src/share/lib/security/java.security-%{_target_os} %global cacerts_file /etc/pki/java/cacerts @@ -352,46 +433,6 @@ %endif %endif -# e.g. aarch64-shenandoah-jdk8u212-b04-shenandoah-merge-2019-04-30 -> aarch64-shenandoah-jdk8u212-b04 -%global version_tag %(VERSION=%{shenandoah_revision}; echo ${VERSION%%-shenandoah-merge*}) -# eg # jdk8u60-b27 -> jdk8u60 or # aarch64-jdk8u60-b27 -> aarch64-jdk8u60 (dont forget spec escape % by %%) -%global whole_update %(VERSION=%{version_tag}; echo ${VERSION%%-*}) -# eg jdk8u60 -> 60 or aarch64-jdk8u60 -> 60 -%global updatever %(VERSION=%{whole_update}; echo ${VERSION##*u}) -# eg jdk8u60-b27 -> b27 -%global buildver %(VERSION=%{version_tag}; echo ${VERSION##*-}) -%global rpmrelease 3 -# Settings used by the portable build -%global portablerelease 1 -# Portable suffix differs between RHEL and CentOS -%if 0%{?centos} == 0 -%global portablerhel 8 -%else -%global portablerhel 8 -%endif - -%if 0%{?almalinux} -%global portablerhel 8 -%endif -%global portablesuffix el%{portablerhel} -%global portablebuilddir /builddir/build/BUILD - -# Define milestone (EA for pre-releases, GA ("fcs") for releases) -# Release will be (where N is usually a number starting at 1): -# - 0.N%%{?extraver}%%{?dist} for EA releases, -# - N%%{?extraver}{?dist} for GA releases -%global is_ga 1 -%if %{is_ga} -%global milestone fcs -%global milestone_version %{nil} -%global extraver %{nil} -%global eaprefix %{nil} -%else -%global milestone ea -%global milestone_version "-ea" -%global extraver .%{milestone} -%global eaprefix 0. -%endif # priority must be 7 digits in total; up to openjdk 1.8 %if %is_system_jdk %global priority 1800%{updatever} @@ -400,11 +441,6 @@ %global priority 0000001 %endif -%global javaver 1.%{majorver}.0 - -# parametrized macros are order-sensitive -%global compatiblename %{name} -%global fullversion %{compatiblename}-%{version}-%{release} # images directories from upstream build %global jdkimage j2sdk-image # output dir stub @@ -424,11 +460,10 @@ %if %is_system_jdk %global __provides_exclude ^(%{_privatelibs})$ %global __requires_exclude ^(%{_privatelibs})$ -# Never generate lib-style provides/requires for slowdebug packages -%global __provides_exclude_from ^.*/%{uniquesuffix -- %{debug_suffix_unquoted}}/.*$ -%global __requires_exclude_from ^.*/%{uniquesuffix -- %{debug_suffix_unquoted}}/.*$ -%global __provides_exclude_from ^.*/%{uniquesuffix -- %{fastdebug_suffix_unquoted}}/.*$ -%global __requires_exclude_from ^.*/%{uniquesuffix -- %{fastdebug_suffix_unquoted}}/.*$ +# Never generate lib-style provides/requires for any debug packages +%global exclude_from_regexp ^.*/%{uniquesuffix -- %{debug_suffix_unquoted}}/.*$|^.*/%{uniquesuffix -- %{fastdebug_suffix_unquoted}}/.*$ +%global __provides_exclude_from %{exclude_from_regexp} +%global __requires_exclude_from %{exclude_from_regexp} %else # Don't generate provides/requires for JDK provided shared libraries at all. %global __provides_exclude ^(%{_privatelibs}|%{_publiclibs})$ @@ -450,7 +485,7 @@ %global rpm_state_dir %{_localstatedir}/lib/rpm-state/ # For flatpack builds hard-code /usr/sbin/alternatives, -# otherwise use %%{_sbindir} relative path. +# otherwise use <_sbindir> relative path. %if 0%{?flatpak} %global alternatives_requires /usr/sbin/alternatives %else @@ -474,7 +509,7 @@ %global tapsetdir %{tapsetdirttapset}/%{stapinstall} %endif -# not-duplicated scriptlets for normal/debug packages +# non-duplicated scriptlets for normal/debug packages %global update_desktop_icons /usr/bin/gtk-update-icon-cache %{_datadir}/icons/hicolor &>/dev/null || : %define save_alternatives() %{expand: @@ -856,6 +891,7 @@ exit 0 %license %{_jvmdir}/%{jredir -- %{?1}}/ASSEMBLY_EXCEPTION %license %{_jvmdir}/%{jredir -- %{?1}}/LICENSE %license %{_jvmdir}/%{jredir -- %{?1}}/THIRD_PARTY_README +%dir %{_defaultdocdir}/%{uniquejavadocdir -- %{?1}} %doc %{_defaultdocdir}/%{uniquejavadocdir -- %{?1}}/NEWS %doc %{_defaultdocdir}/%{uniquejavadocdir -- %{?1}}/README.md %doc %{_defaultdocdir}/%{uniquejavadocdir -- %{?1}}/java-1.%{majorver}.0-openjdk-portable.specfile @@ -1237,8 +1273,9 @@ exit 0 %define files_javadoc_zip() %{expand: %defattr(-,root,root,-) +%dir %{_javadocdir}/%{uniquejavadocdir -- %{?1}} %doc %{_javadocdir}/%{uniquejavadocdir -- %{?1}}.zip -#javadoc is in jdk8 noarch, so also licnese file must be treated like it +#javadoc is in jdk8 noarch, so also license file must be treated like it %ifarch %{portable_build_arches} %license %{installoutputdir -- %{?1}}/jre/LICENSE %else @@ -1285,8 +1322,8 @@ Provides: jre%{?1} = %{epoch}:%{version}-%{release} Requires: ca-certificates # Require javapackages-filesystem for ownership of /usr/lib/jvm/ and macros Requires: javapackages-filesystem -# 2025b required as of JDK-8352716 -Requires: tzdata-java >= 2025b +# 2026b required as of JDK-8383175 +Requires: tzdata-java >= 2026b # for support of kernel stream control # libsctp.so.1 is being `dlopen`ed on demand Requires: lksctp-tools%{?_isa} @@ -1386,50 +1423,17 @@ Provides: java-%{origin}-src%{?1} = %{epoch}:%{version}-%{release} %endif } - # Prevent brp-java-repack-jars from being run %global __jar_repack 0 -Name: java-%{javaver}-%{origin} -Version: %{javaver}.%{updatever}.%{buildver} -Release: %{?eaprefix}%{rpmrelease}%{?extraver}%{?dist}.alma.1 -# Equivalent for the portable build -%global pversion %{version} -%global prelease %{?eaprefix}%{portablerelease}%{?extraver} -# java-1.5.0-ibm from jpackage.org set Epoch to 1 for unknown reasons -# and this change was brought into RHEL-4. java-1.5.0-ibm packages -# also included the epoch in their virtual provides. This created a -# situation where in-the-wild java-1.5.0-ibm packages provided "java = -# 1:1.5.0". In RPM terms, "1.6.0 < 1:1.5.0" since 1.6.0 is -# interpreted as 0:1.6.0. So the "java >= 1.6.0" requirement would be -# satisfied by the 1:1.5.0 packages. Thus we need to set the epoch in -# JDK package >= 1.6.0 to 1, and packages referring to JDK virtual -# provides >= 1.6.0 must specify the epoch, "java >= 1:1.6.0". - -Epoch: 1 -Summary: %{origin_nice} %{majorver} Runtime Environment - -# HotSpot code is licensed under GPLv2 -# JDK library code is licensed under GPLv2 with the Classpath exception -# The Apache license is used in code taken from Apache projects (primarily JAXP & JAXWS) -# DOM levels 2 & 3 and the XML digital signature schemas are licensed under the W3C Software License -# The JSR166 concurrency code is in the public domain -# The BSD and MIT licenses are used for a number of third-party libraries (see THIRD_PARTY_README) -# The OpenJDK source tree includes the JPEG library (IJG), zlib & libpng (zlib), giflib and LCMS (MIT) -# The test code includes copies of NSS under the Mozilla Public License v2.0 -# The PCSClite headers are under a BSD with advertising license -# The elliptic curve cryptography (ECC) source code is licensed under the LGPLv2.1 or any later version -License: ASL 1.1 and ASL 2.0 and BSD and BSD with advertising and GPL+ and GPLv2 and GPLv2 with exceptions and IJG and LGPLv2+ and MIT and MPLv2.0 and Public Domain and W3C and zlib -URL: http://openjdk.java.net/ - # Shenandoah HotSpot # openjdk/shenandoah-jdk8u contains an integration forest of # OpenJDK 8u and the Shenandoah garbage collector # To regenerate, use: -# VERSION=%%{shenandoah_revision} +# VERSION= # FILE_NAME_ROOT=${VERSION} # REPO_ROOT= generate_source_tarball.sh -# where the source is obtained from http://github.com/%%{project}/%%{repo} +# where the source is obtained from http://github.com// Source0: %{shenandoah_revision}.tar.xz # Use 'icedtea_sync.sh' to update the following @@ -1478,11 +1482,11 @@ Source21: NEWS Source22: repack_reproducible_policies.sh # Setup variables to reference correct sources -%global releasezip %{_jvmdir}/%{name}-portable-%{pversion}-%{prelease}.portable.unstripped.jdk.%{_arch}.tar.xz -%global docszip %{_jvmdir}/%{name}-portable-%{pversion}-%{prelease}.portable.docs.%{_arch}.tar.xz -%global misczip %{_jvmdir}/%{name}-portable-%{pversion}-%{prelease}.portable.misc.%{_arch}.tar.xz -%global slowdebugzip %{_jvmdir}/%{name}-portable-%{pversion}-%{prelease}.portable.slowdebug.jdk.%{_arch}.tar.xz -%global fastdebugzip %{_jvmdir}/%{name}-portable-%{pversion}-%{prelease}.portable.fastdebug.jdk.%{_arch}.tar.xz +%global releasezip %{_jvmdir}/%{name}-%{version}-%{prelease}.portable.unstripped.jdk.%{_arch}.tar.xz +%global docszip %{_jvmdir}/%{name}-%{version}-%{prelease}.portable.docs.%{_arch}.tar.xz +%global misczip %{_jvmdir}/%{name}-%{version}-%{prelease}.portable.misc.%{_arch}.tar.xz +%global slowdebugzip %{_jvmdir}/%{name}-%{version}-%{prelease}.portable.slowdebug.jdk.%{_arch}.tar.xz +%global fastdebugzip %{_jvmdir}/%{name}-%{version}-%{prelease}.portable.fastdebug.jdk.%{_arch}.tar.xz ############################################ # @@ -1502,10 +1506,12 @@ Patch534: rh1648246-always_instruct_vm_to_assume_multiple_processors_are_availab Patch1000: rh1648249-add_commented_out_nss_cfg_provider_to_java_security.patch # RH1582504: Use RSA as default for keytool, as DSA is disabled in all crypto policies except LEGACY Patch1003: rh1582504-rsa_default_for_keytool.patch +# RH1750419: Enable build of speculative store bypass hardened alt-java (CVE-2018-3639) +Patch600: rh1750419-redhat_alt_java.patch # Crypto policy and FIPS support patches # Patch is generated from the fips tree at https://github.com/rh-openjdk/jdk8u/tree/fips -# as follows: git diff %%{openjdk_revision} common jdk > fips-8u-$(git show -s --format=%h HEAD).patch +# as follows: git diff common jdk > fips-8u-$(git show -s --format=%h HEAD).patch # Diff is limited to src and make subdirectories to exclude .github changes # Fixes currently included: # PR3183, RH1340845: Support Fedora/RHEL8 system crypto policy @@ -1549,8 +1555,8 @@ Patch528: pr3083-rh1346460-for_ssl_debug_return_null_instead_of_exception_when_t Patch539: pr2888-rh2055274-support_system_cacerts-%{cacertsver}.patch # RH1684077, JDK-8009550: Depend on pcsc-lite-libs instead of pcsc-lite-devel as this is only in optional repo Patch541: rh1684077-openjdk_should_depend_on_pcsc-lite-libs_instead_of_pcsc-lite-devel.patch -# RH1750419: Enable build of speculative store bypass hardened alt-java (CVE-2018-3639) -Patch600: rh1750419-redhat_alt_java.patch +# JDK-8385876: [8u] hotspot/src/share/vm/code/compiledIC.cpp:406:30: error: 'this' pointer is null +Patch542: jdk8385876-zero_this_pointer_is_null.patch ############################################# # @@ -1597,8 +1603,6 @@ Patch204: jdk8042159-allow_using_system_installed_lcms2-jdk.patch Patch581: jdk8257794-remove_broken_assert.patch # JDK-8186464, RH1433262: ZipFile cannot read some InfoZip ZIP64 zip files Patch12: jdk8186464-rh1433262-zip64_failure.patch -# JDK-8328999, RH2251025 - Update GIFlib to 5.2.2 (PR#571) -Patch13: jdk8328999-update_giflib_5.2.2.patch # JDK-8141590 - Cannot build Zero with devkit Patch14: jdk8141590-bundle_libffi.patch Patch15: jdk8141590-bundle_libffi-followup.patch @@ -1682,16 +1686,16 @@ BuildRequires: zip BuildRequires: javapackages-filesystem %ifarch %{portable_build_arches} %if %{include_normal_build} -BuildRequires: java-1.%{majorver}.0-openjdk-portable-unstripped = %{epoch}:%{pversion}-%{prelease}.%{portablesuffix} +BuildRequires: java-1.%{majorver}.0-openjdk-portable-unstripped = %{epoch}:%{version}-%{prelease}.%{portablesuffix} %endif %if %{include_fastdebug_build} -BuildRequires: java-1.%{majorver}.0-openjdk-portable-devel-fastdebug = %{epoch}:%{pversion}-%{prelease}.%{portablesuffix} +BuildRequires: java-1.%{majorver}.0-openjdk-portable-devel-fastdebug = %{epoch}:%{version}-%{prelease}.%{portablesuffix} %endif %if %{include_debug_build} -BuildRequires: java-1.%{majorver}.0-openjdk-portable-devel-slowdebug = %{epoch}:%{pversion}-%{prelease}.%{portablesuffix} +BuildRequires: java-1.%{majorver}.0-openjdk-portable-devel-slowdebug = %{epoch}:%{version}-%{prelease}.%{portablesuffix} %endif -BuildRequires: java-1.%{majorver}.0-openjdk-portable-docs = %{epoch}:%{pversion}-%{prelease}.%{portablesuffix} -BuildRequires: java-1.%{majorver}.0-openjdk-portable-misc = %{epoch}:%{pversion}-%{prelease}.%{portablesuffix} +BuildRequires: java-1.%{majorver}.0-openjdk-portable-docs = %{epoch}:%{version}-%{prelease}.%{portablesuffix} +BuildRequires: java-1.%{majorver}.0-openjdk-portable-misc = %{epoch}:%{version}-%{prelease}.%{portablesuffix} %else # Require a boot JDK which doesn't fail due to RH1482244 BuildRequires: java-%{buildjdkver}-openjdk-devel >= 1.7.0.151-2.6.11.3 @@ -1701,8 +1705,8 @@ BuildRequires: java-%{buildjdkver}-openjdk-devel >= 1.7.0.151-2.6.11.3 BuildRequires: libffi BuildRequires: libffi-devel %endif -# 2025a required as of JDK-8347965 -BuildRequires: tzdata-java >= 2025a +# 2026b required as of JDK-8383175 +BuildRequires: tzdata-java >= 2026b # Earlier versions have a bug in tree vectorization on PPC BuildRequires: gcc >= 4.8.3-8 @@ -1719,17 +1723,17 @@ BuildRequires: libpng-devel BuildRequires: zlib-devel %else # Version in jdk/src/share/native/sun/awt/libfreetype/include/freetype/freetype.h -Provides: bundled(freetype) = 2.13.3 +Provides: bundled(freetype) = 2.14.3 # Version in jdk/src/share/native/sun/awt/giflib/gif_lib.h -Provides: bundled(giflib) = 5.2.2 +Provides: bundled(giflib) = 6.1.2 # Version in jdk/src/share/native/sun/java2d/cmm/lcms/lcms2.h -Provides: bundled(lcms2) = 2.14.0 +Provides: bundled(lcms2) = 2.19.1 # Version in jdk/src/share/native/sun/awt/image/jpeg/jpeglib.h Provides: bundled(libjpeg) = 6b # Version in jdk/src/share/native/sun/awt/libpng/png.h -Provides: bundled(libpng) = 1.6.51 +Provides: bundled(libpng) = 1.6.57 # Version in jdk/src/share/native/java/util/zip/zlib/zlib.h -Provides: bundled(zlib) = 1.3.1 +Provides: bundled(zlib) = 1.3.2 %ifnarch %{portable_build_arches} # We link statically against libstdc++ to increase portability BuildRequires: libstdc++-static @@ -1971,12 +1975,14 @@ echo "Milestone: %{milestone}" export XZ_OPT="-T0" %endif %setup -q -c -n %{uniquesuffix ""} -T -a 0 + # https://bugzilla.redhat.com/show_bug.cgi?id=1189084 prioritylength=`expr length %{priority}` if [ $prioritylength -ne 7 ] ; then echo "priority must be 7 digits in total, violated" exit 14 fi + # For old patches ln -s %{top_level_dir_name} jdk8 ln -s %{top_level_dir_name} openjdk @@ -1990,20 +1996,6 @@ cp %{SOURCE101} %{top_level_dir_name}/common/autoconf/build-aux/ # OpenJDK patches -# This syntax is deprecated: -# %patchN [...] -# and should be replaced with: -# %patch -PN [...] -# For example: -# %patch1001 -p1 -# becomes: -# %patch -P1001 -p1 -# The replacement format suggested by recent (circa Fedora 38) RPM -# deprecation messages: -# %patch N [...] -# is not backward-compatible with prior (circa RHEL-8) versions of -# rpmbuild. - %if %{system_libs} # Remove libraries that are linked sh %{SOURCE12} @@ -2040,12 +2032,12 @@ popd %patch -P574 %patch -P581 %patch -P541 -%patch -P12 pushd %{top_level_dir_name} +%patch -P12 -p1 %patch -P502 -p1 -%patch -P13 -p1 %patch -P14 -p1 %patch -P15 -p1 +%patch -P542 -p1 popd # Early fixes @@ -2144,7 +2136,6 @@ sed -i -e "s:^security.systemCACerts=.*:security.systemCACerts=%{cacerts_file}:" export NUM_PROC=%(/usr/bin/getconf _NPROCESSORS_ONLN 2> /dev/null || :) export NUM_PROC=${NUM_PROC:-1} %if 0%{?_smp_ncpus_max} -# Honor %%_smp_ncpus_max [ ${NUM_PROC} -gt %{?_smp_ncpus_max} ] && export NUM_PROC=%{?_smp_ncpus_max} %endif @@ -2371,7 +2362,7 @@ for suffix in %{build_loop} ; do %endif %endif # Fix build paths in ELF files so it looks like we built them - portablenvr="%{name}-portable-%{pversion}-%{prelease}.%{portablesuffix}.%{_arch}" + portablenvr="%{name}-%{VERSION}-%{prelease}.%{portablesuffix}.%{_arch}" for file in $(find ${installdir} -type f) ; do if ! echo ${file} | grep -q 'libffi' ; then if file ${file} | grep -q 'ELF'; then @@ -2761,9 +2752,9 @@ done -- see https://bugzilla.redhat.com/show_bug.cgi?id=1290388 for pretrans over pre -- if copy-jdk-configs is in transaction, it installs in pretrans to temp -- if copy_jdk_configs is in temp, then it means that copy-jdk-configs is in transaction and so is --- preferred over one in %%{_libexecdir}. If it is not in transaction, then depends +-- preferred over one in <_libexecdir>. If it is not in transaction, then depends -- whether copy-jdk-configs is installed or not. If so, then configs are copied --- (copy_jdk_configs from %%{_libexecdir} used) or not copied at all +-- (copy_jdk_configs from <_libexecdir> used) or not copied at all local posix = require "posix" if (os.getenv("debug") == "true") then @@ -2974,9 +2965,113 @@ cjc.mainProgram(args) %endif %changelog -* Mon Mar 30 2026 Eduard Abdullin - 1:1.8.0.482.b08-3.alma.1 +* Thu Sep 03 2026 Eduard Abdullin - 1:1.8.0.504.b01-2.1.alma.1 - Change portablerhel +* Sun Aug 23 2026 Andrew Hughes - 1:1.8.0.504.b01-2.1 +- Sync the copy of the portable specfile with the latest update +- Related: RHEL-235603 + +* Wed Aug 12 2026 Andrew Hughes - 1:1.8.0.504.b01-1.2 +- Add CVEs for August 2026 release +- Bump release for PQC build +- ** This tarball is embargoed until 2026-08-18 @ 1pm PT. ** +- Related: RHEL-235603 + +* Mon Aug 10 2026 Andrew Hughes - 1:1.8.0.504.b01-1.1 +- Update to 8u504-b01 (GA). +- Update release notes for 8u504-b01. +- Bump FreeType version to 2.14.3 following JDK-8385390 +- Sync the copy of the portable specfile with the latest update +- ** This tarball is embargoed until 2026-08-18 @ 1pm PT. ** +- Resolves: RHEL-235603 + +* Mon Jul 27 2026 Andrew Hughes - 1:1.8.0.502.b07-2.1 +- Add CVEs to NEWS file +- Related: RHEL-188852 + +* Sat Jul 18 2026 Andrew Hughes - 1:1.8.0.502.b07-1.2 +- Bump release for PQC build +- Related: RHEL-212095 +- Related: RHEL-188852 +- Related: RHEL-149784 +- Related: RHEL-212316 +- Related: RHEL-212318 +- Related: RHEL-212329 +- Related: RHEL-212330 +- Related: RHEL-212327 +- Related: RHEL-212328 + +* Fri Jul 17 2026 Andrew Hughes - 1:1.8.0.502.b07-1.1 +- Update to 8u502-b07 (GA). +- Update release notes for 8u502-b07. +- Bump lcms2 version to 2.19.1 following JDK-8321489, JDK-8348110, JDK-8375065 & JDK-8383354 +- Bump zlib version to 1.3.2 following JDK-8378631 +- Require tzdata 2026b due to upstream inclusion of JDK-8383175 +- Add attempted patch for JDK-8385876 to fix -Wnonnull build failure with s390x Zero on CentOS 9 +- Remove macro references in comments where possible (%dnl not compatible enough yet) +- Move version information and core NVR definitions back towards the top of the file +- Explictly define supported architectures +- Specify portablerelease and rpmrelease (always 0 for portables) in the Release field +- Make zone string debug output optional in TestTranslations +- Change javadoc-zip to just own the top-level directory, not include the entire subtree +- Update tagged versions to include 9.8.0-z & 9.9.0. +- Cleanup tagging and gating scripts to appease shellcheck: +- * scripts/builds/build_vanilla.sh: Use an array to handle the varying arguments to rhpkg. +- * scripts/builds/check_signatures.sh: Quote variable usage. +- * scripts/builds/waive_issue.sh: Remove redundant 'test "x"' usage. +- * scripts/builds/waive_leapp_issue.sh: Likewise. +- * scripts/builds/waive_rpminspect.sh: Likewise. +- * scripts/builds/waive_usual_rpminspect.sh: Likewise and add missing WORKING_DIR variable. +- * scripts/builds/waive_usual_tier0.sh: Remove redundant 'test "x"' usage. +- Obsolete old RHEL releases (8.2.0-z, 9.0.0-z, 9.7.0-z) +- Sync the copy of the portable specfile with the latest update +- Sync portable naming with later JDKs, due to adoption of by portable +- Drop which is a redundant alias for version now +- ** This tarball is embargoed until 2026-07-21 @ 1pm PT. ** +- Resolves: RHEL-212095 +- Resolves: RHEL-188852 +- Resolves: RHEL-149784 +- Resolves: RHEL-212316 +- Resolves: RHEL-212318 +- Related: RHEL-212327 +- Resolves: RHEL-212329 +- Resolves: RHEL-212330 + +* Fri Jul 17 2026 Thomas Fitzsimmons - 1:1.8.0.502.b07-1.1 +- Make headless own /usr/share/doc/java-1.8.0-openjdk +- Make javadoc-zip own /usr/share/javadoc/java-1.8.0-openjdk +- Do not overwrite slowdebug __provides_exclude_from and __requires_exclude_from regexps +- Resolves: RHEL-212327 +- Resolves: RHEL-212328 + +* Mon Apr 20 2026 Andrew Hughes - 1:1.8.0.492.b09-2 +- Bump release for PQC build +- Related: RHEL-169446 + +* Fri Apr 17 2026 Andrew Hughes - 1:1.8.0.492.b09-1 +- Update to 8u492-b09 (GA) +- Update release notes for 8u492-b09. +- Add missing CVEs for 8u482. +- Regenerate JDK-8199936/PR3533 patch following JDK-8374917 +- Regenerate JDK-8186464/RH1433262 patch following JDK-8370986 +- Drop local giflib 5.2.2 patch now JDK-8328999 is included upstream +- Bump freetype version to 2.14.2 following JDK-8373290 & JDK-8379158 +- Bump giflib version to 6.1.2 following JDK-8379256 & JDK-8380078 +- Bump LCMS 2 version to 2.15.0 following JDK-8303482 +- Bump libpng version to 1.6.57 following JDK-8375063, JDK-8377526, JDK-8380959 & JDK-8382047 +- Sync the copy of the portable specfile with the latest update +- ** This tarball is embargoed until 2026-04-21 @ 1pm PT. ** +- Resolves: RHEL-169446 +- Resolves: RHEL-133291 +- Resolves: RHEL-147348 +- Resolves: RHEL-148407 +- Resolves: RHEL-148981 +- Resolves: RHEL-161303 +- Resolves: RHEL-161452 +- Resolves: RHEL-157139 +- Resolves: RHEL-157156 + * Fri Feb 20 2026 Andrew Hughes - 1:1.8.0.482.b08-3 - Update tagging scripts to include signature checks and correctly handle gating - Add gating scripts to simplify obtaining results and waiving issues