Commit 99623ef for zlib

commit 99623ef7097352da7993ba614161fd6a311e046e
Author: Mark Adler <git@madler.net>
Date:   Wed Nov 4 20:32:10 2026 -0800

    zlib 1.4

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 8da47ea..2ccbab9 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 3.15...3.31)
 project(
     zlib
     LANGUAGES C
-    VERSION 1.3.2.1
+    VERSION 1.4
     HOMEPAGE_URL "https://zlib.net/"
     DESCRIPTION "a general-purpose lossless data-compression library")

diff --git a/ChangeLog b/ChangeLog
index 4e86c26..228a03a 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,8 +1,36 @@

                 ChangeLog file for zlib

-Changes in 1.3.2.1 (xx Feb 2026)
--
+Changes in 1.4 (4 Nov 2026)
+- Change CMake library names on MSVC
+- Return z_off_t default to long for portability
+- Fail gzopen() with "x" if O_EXCL not available
+- Deliver all gzip data before reporting error
+- Fix gzwrite() buffer overflow (CVE-2026-85091)
+- Fix inflateGetDictionary() write past buffer on invalid window size
+- Fix window write overrun after inflateSync()
+- Fix read before provided data after repeated inflatePrime()'s
+- Fix write past pending buffer after repeated deflatePrime()'s
+- Fix copy of uninitialized memory by inflateBack() on invalid data
+- Fix copy of uninitialized memory after gzseek() as first write action
+- Fix read outside window after a deflateResetKeep() mid-stream
+- Avoid out-of-bounds pointer arithmetic in infback9() (CVE-2026-4738)
+- Fix several vulnerabilities in contrib/minizip
+- Fix truncated stream detection in gzread()
+- Fix pending skip handling in gzread()
+- Fix loss of zero fill on repeated gzseek()'s when writing
+- Fix inaccurate total_in after Z_NEED_DICT returned
+- Detect and report bad deflateSetDictionary() calls
+- Avoid undefined behaviors in C language usage
+- Fix minizip extra field overflows when almost full and need Zip64
+- Don't assume NULL is defined in compress.c and uncompr.c
+- Use the generated zconf.h when building test programs out of tree
+- Improve portability and functionality of CMake builds
+- Provide 64-bit file offsets on Windows with #defines as on Linux
+- Improve portability to Android, AIX, PowerPC, s390x, and Windows
+- Use a PCG random number generator instead of rand() in minizip
+- Clarify documentation
+- (See https://github.com/madler/zlib for all 195 commits)

 Changes in 1.3.2 (17 Feb 2026)
 - Continued rewrite of CMake build [Vollstrecker]
diff --git a/Makefile.in b/Makefile.in
index 55c8fb0..75adc39 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -31,7 +31,7 @@ VGFMAFLAG=

 STATICLIB=libz.a
 SHAREDLIB=libz.so
-SHAREDLIBV=libz.so.1.3.2.1
+SHAREDLIBV=libz.so.1.4
 SHAREDLIBM=libz.so.1
 LIBS=$(STATICLIB) $(SHAREDLIBV)

diff --git a/README b/README
index e28388b..265c8b4 100644
--- a/README
+++ b/README
@@ -1,6 +1,6 @@
 ZLIB DATA COMPRESSION LIBRARY

-zlib 1.3.2.1 is a general purpose data compression library.  All the code is
+zlib 1.4 is a general purpose data compression library.  All the code is
 thread safe (though see the FAQ for caveats).  The data format used by the zlib
 library is described by RFCs (Request for Comments) 1950 to 1952 at
 https://datatracker.ietf.org/doc/html/rfc1950 (zlib format), rfc1951 (deflate
@@ -31,7 +31,7 @@ Mark Nelson <markn@ieee.org> wrote an article about zlib for the Jan.  1997
 issue of Dr.  Dobb's Journal; a copy of the article is available at
 https://zlib.net/nelson/ .

-The changes made in version 1.3.2.1 are documented in the file ChangeLog.
+The changes made in version 1.4 are documented in the file ChangeLog.

 Unsupported third party contributions are provided in directory contrib/ .

diff --git a/contrib/delphi/ZLib.pas b/contrib/delphi/ZLib.pas
index ef9047e..f7c389b 100644
--- a/contrib/delphi/ZLib.pas
+++ b/contrib/delphi/ZLib.pas
@@ -152,7 +152,7 @@ procedure DecompressToUserBuf(const InBuf: Pointer; InBytes: Integer;
   const OutBuf: Pointer; BufSize: Integer);

 const
-  zlib_version = '1.3.2.1';
+  zlib_version = '1.4';

 type
   EZlibError = class(Exception);
diff --git a/contrib/dotzlib/DotZLib/UnitTests.cs b/contrib/dotzlib/DotZLib/UnitTests.cs
index 2de5cbe..22110b7 100644
--- a/contrib/dotzlib/DotZLib/UnitTests.cs
+++ b/contrib/dotzlib/DotZLib/UnitTests.cs
@@ -156,7 +156,7 @@ namespace DotZLibTests
         public void Info_Version()
         {
             Info info = new Info();
-            Assert.AreEqual("1.3.2.1", Info.Version);
+            Assert.AreEqual("1.4", Info.Version);
             Assert.AreEqual(32, info.SizeOfUInt);
             Assert.AreEqual(32, info.SizeOfULong);
             Assert.AreEqual(32, info.SizeOfPointer);
diff --git a/contrib/infback9/inftree9.c b/contrib/infback9/inftree9.c
index ef67b2d..4044a2a 100644
--- a/contrib/infback9/inftree9.c
+++ b/contrib/infback9/inftree9.c
@@ -9,7 +9,7 @@
 #define MAXBITS 15

 const char inflate9_copyright[] =
-   " inflate9 1.3.2.1 Copyright 1995-2026 Mark Adler ";
+   " inflate9 1.4 Copyright 1995-2026 Mark Adler ";
 /*
   If you use the zlib library in a product, an acknowledgment is welcome
   in the documentation of your product. If for some reason you cannot
@@ -59,7 +59,7 @@ int inflate_table9(codetype type, unsigned short FAR *lens, unsigned codes,
     static const unsigned short lext[31] = { /* Length codes 257..285 extra */
         128, 128, 128, 128, 128, 128, 128, 128, 129, 129, 129, 129,
         130, 130, 130, 130, 131, 131, 131, 131, 132, 132, 132, 132,
-        133, 133, 133, 133, 144, 68, 193};
+        133, 133, 133, 133, 144, 71, 77};
     static const unsigned short dbase[32] = { /* Distance codes 0..31 base */
         1, 2, 3, 4, 5, 7, 9, 13, 17, 25, 33, 49,
         65, 97, 129, 193, 257, 385, 513, 769, 1025, 1537, 2049, 3073,
diff --git a/contrib/minizip/configure.ac b/contrib/minizip/configure.ac
index 9be4262..e79d581 100644
--- a/contrib/minizip/configure.ac
+++ b/contrib/minizip/configure.ac
@@ -1,7 +1,7 @@
 #                                               -*- Autoconf -*-
 # Process this file with autoconf to produce a configure script.

-AC_INIT([minizip], [1.3.2.1], [bugzilla.redhat.com])
+AC_INIT([minizip], [1.4], [bugzilla.redhat.com])
 AC_CONFIG_SRCDIR([minizip.c])
 AM_INIT_AUTOMAKE([foreign])
 LT_INIT
diff --git a/contrib/nuget/nuget.csproj b/contrib/nuget/nuget.csproj
index e897228..5b22337 100644
--- a/contrib/nuget/nuget.csproj
+++ b/contrib/nuget/nuget.csproj
@@ -7,7 +7,7 @@
     <PackageId Condition="$([MSBuild]::IsOSPlatform('Linux'))">$(PackageId).linux</PackageId>
     <PackageId Condition="$([MSBuild]::IsOSPlatform('OSX'))">$(PackageId).osx</PackageId>
     <Copyright>(C) 1995-2026 Jean-loup Gailly and Mark Adler</Copyright>
-    <version>1.3.2.1</version>
+    <version>1.4</version>
     <PackageDescription>NuGet Package for consuming native builds of zlib into .NET without complexity.</PackageDescription>
     <PackageReadmeFile>README</PackageReadmeFile>
     <!--
diff --git a/contrib/pascal/zlibpas.pas b/contrib/pascal/zlibpas.pas
index a05b77d..942ffae 100644
--- a/contrib/pascal/zlibpas.pas
+++ b/contrib/pascal/zlibpas.pas
@@ -10,8 +10,8 @@ unit zlibpas;
 interface

 const
-  ZLIB_VERSION = '1.3.2.1';
-  ZLIB_VERNUM  = $1321;
+  ZLIB_VERSION = '1.4';
+  ZLIB_VERNUM  = $1400;

 type
   alloc_func = function(opaque: Pointer; items, size: Integer): Pointer;
diff --git a/contrib/zlib1-dll/CMakeLists.txt b/contrib/zlib1-dll/CMakeLists.txt
index 93ade2b..8fe4e4a 100644
--- a/contrib/zlib1-dll/CMakeLists.txt
+++ b/contrib/zlib1-dll/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 3.20...3.31)
 project(
     zlib1-dll
     LANGUAGES C
-    VERSION 1.3.2.1
+    VERSION 1.4
     HOMEPAGE_URL "https://zlib.net/"
     DESCRIPTION "zlib1.dll is the legacy DLL with zlib and minizip")

diff --git a/deflate.c b/deflate.c
index 7d8d027..1e585aa 100644
--- a/deflate.c
+++ b/deflate.c
@@ -52,7 +52,7 @@
 #include "deflate.h"

 const char deflate_copyright[] =
-   " deflate 1.3.2.1 Copyright 1995-2026 Jean-loup Gailly and Mark Adler ";
+   " deflate 1.4 Copyright 1995-2026 Jean-loup Gailly and Mark Adler ";
 /*
   If you use the zlib library in a product, an acknowledgment is welcome
   in the documentation of your product. If for some reason you cannot
diff --git a/inftrees.c b/inftrees.c
index 99d8d77..0fb8570 100644
--- a/inftrees.c
+++ b/inftrees.c
@@ -23,7 +23,7 @@
 #define MAXBITS 15

 const char inflate_copyright[] =
-   " inflate 1.3.2.1 Copyright 1995-2026 Mark Adler ";
+   " inflate 1.4 Copyright 1995-2026 Mark Adler ";
 /*
   If you use the zlib library in a product, an acknowledgment is welcome
   in the documentation of your product. If for some reason you cannot
@@ -71,7 +71,7 @@ int ZLIB_INTERNAL inflate_table(codetype type, unsigned short FAR *lens,
         35, 43, 51, 59, 67, 83, 99, 115, 131, 163, 195, 227, 258, 0, 0};
     static const unsigned short lext[31] = { /* Length codes 257..285 extra */
         16, 16, 16, 16, 16, 16, 16, 16, 17, 17, 17, 17, 18, 18, 18, 18,
-        19, 19, 19, 19, 20, 20, 20, 20, 21, 21, 21, 21, 16, 68, 193};
+        19, 19, 19, 19, 20, 20, 20, 20, 21, 21, 21, 21, 16, 71, 77};
     static const unsigned short dbase[32] = { /* Distance codes 0..29 base */
         1, 2, 3, 4, 5, 7, 9, 13, 17, 25, 33, 49, 65, 97, 129, 193,
         257, 385, 513, 769, 1025, 1537, 2049, 3073, 4097, 6145,
diff --git a/os400/README400 b/os400/README400
index 8164f78..28852dc 100644
--- a/os400/README400
+++ b/os400/README400
@@ -1,4 +1,4 @@
-        ZLIB version 1.3.2.1 for OS/400 installation instructions
+        ZLIB version 1.4 for OS/400 installation instructions

 1) Download and unpack the zlib tarball to some IFS directory.
    (i.e.: /path/to/the/zlib/ifs/source/directory)
diff --git a/os400/zlibfixed.rpgle b/os400/zlibfixed.rpgle
index 832960d..c257f64 100644
--- a/os400/zlibfixed.rpgle
+++ b/os400/zlibfixed.rpgle
@@ -1,7 +1,7 @@
       *  ZLIB.INC - Interface to the general purpose compression library
       *
       *  ILE RPG400 version by Patrick Monnerat, DATASPHERE.
-      *  Version 1.3.2.1
+      *  Version 1.4
       *
       *
       *  WARNING:
@@ -22,14 +22,14 @@
       *
       *  Versioning information.
       *
-     D ZLIB_VERSION    C                   '1.3.2.1'
-     D ZLIB_VERNUM     C                   X'1321'
+     D ZLIB_VERSION    C                   '1.4'
+     D ZLIB_VERNUM     C                   X'1400'
      D ZLIB_VER_MAJOR  C                   1
-     D ZLIB_VER_MINOR  C                   3
+     D ZLIB_VER_MINOR  C                   4
      D ZLIB_VER_REVISION...
-     D                 C                   2
+     D                 C                   0
      D ZLIB_VER_SUBREVISION...
-     D                 C                   1
+     D                 C                   0
       *
       *  Other equates.
       *
diff --git a/os400/zlibfree.rpgle b/os400/zlibfree.rpgle
index 1f027da..5e62bba 100644
--- a/os400/zlibfree.rpgle
+++ b/os400/zlibfree.rpgle
@@ -2,7 +2,7 @@
 //  ZLIB.INC - Interface to the general purpose compression library

 //  ILE RPG400 version by Patrick Monnerat, DATASPHERE.
-//  Version 1.3.2.1
+//  Version 1.4


 //  WARNING:
@@ -23,12 +23,12 @@

 //  Versioning information.

-Dcl-C ZLIB_VERSION '1.3.2.1';
-Dcl-C ZLIB_VERNUM X'1321';
+Dcl-C ZLIB_VERSION '1.4';
+Dcl-C ZLIB_VERNUM X'1400';
 Dcl-C ZLIB_VER_MAJOR 1;
-Dcl-C ZLIB_VER_MINOR 3;
-Dcl-C ZLIB_VER_REVISION 2;
-Dcl-C ZLIB_VER_SUBREVISION 1;
+Dcl-C ZLIB_VER_MINOR 4;
+Dcl-C ZLIB_VER_REVISION 0;
+Dcl-C ZLIB_VER_SUBREVISION 0;

 //  Other equates.

diff --git a/qnx/package.qpg b/qnx/package.qpg
index baf4196..cdfd124 100644
--- a/qnx/package.qpg
+++ b/qnx/package.qpg
@@ -25,10 +25,10 @@
       <QPG:Files>
          <QPG:Add file="../zconf.h" install="/opt/include/" user="root:sys" permission="644"/>
          <QPG:Add file="../zlib.h" install="/opt/include/" user="root:sys" permission="644"/>
-         <QPG:Add file="../libz.so.1.3.2.1" install="/opt/lib/" user="root:bin" permission="644"/>
-         <QPG:Add file="libz.so" install="/opt/lib/" component="dev" filetype="symlink" linkto="libz.so.1.3.2.1"/>
-         <QPG:Add file="libz.so.1" install="/opt/lib/" filetype="symlink" linkto="libz.so.1.3.2.1"/>
-         <QPG:Add file="../libz.so.1.3.2.1" install="/opt/lib/" component="slib"/>
+         <QPG:Add file="../libz.so.1.4" install="/opt/lib/" user="root:bin" permission="644"/>
+         <QPG:Add file="libz.so" install="/opt/lib/" component="dev" filetype="symlink" linkto="libz.so.1.4"/>
+         <QPG:Add file="libz.so.1" install="/opt/lib/" filetype="symlink" linkto="libz.so.1.4"/>
+         <QPG:Add file="../libz.so.1.4" install="/opt/lib/" component="slib"/>
       </QPG:Files>

       <QPG:PackageFilter>
@@ -63,7 +63,7 @@
             </QPM:ProductDescription>

             <QPM:ReleaseDescription>
-               <QPM:ReleaseVersion>1.3.2.1</QPM:ReleaseVersion>
+               <QPM:ReleaseVersion>1.4</QPM:ReleaseVersion>
                <QPM:ReleaseUrgency>Medium</QPM:ReleaseUrgency>
                <QPM:ReleaseStability>Stable</QPM:ReleaseStability>
                <QPM:ReleaseNoteMinor></QPM:ReleaseNoteMinor>
diff --git a/treebuild.xml b/treebuild.xml
index 448aed3..5f82ba6 100644
--- a/treebuild.xml
+++ b/treebuild.xml
@@ -1,6 +1,6 @@
 <?xml version="1.0" ?>
-<package name="zlib" version="1.3.2.1">
-    <library name="zlib" dlversion="1.3.2.1" dlname="z">
+<package name="zlib" version="1.4">
+    <library name="zlib" dlversion="1.4" dlname="z">
 	<property name="description"> zip compression library </property>
 	<property name="include-target-dir" value="$(@PACKAGE/install-includedir)" />

diff --git a/win32/README-WIN32.txt b/win32/README-WIN32.txt
index ea08af9..155942b 100644
--- a/win32/README-WIN32.txt
+++ b/win32/README-WIN32.txt
@@ -1,6 +1,6 @@
 ZLIB DATA COMPRESSION LIBRARY

-zlib 1.3.2.1 is a general purpose data compression library.  All the code is
+zlib 1.4 is a general purpose data compression library.  All the code is
 thread safe.  The data format used by the zlib library is described by RFCs
 (Request for Comments) 1950 to 1952 in the files
 https://datatracker.ietf.org/doc/html/rfc1951 (zlib format), rfc1951.txt
@@ -22,7 +22,7 @@ asking for help.

 Manifest:

-The package zlib-1.3.2.1-win32-x86.zip will contain the following files:
+The package zlib-1.4-win32-x86.zip will contain the following files:

   README-WIN32.txt This document
   ChangeLog        Changes since previous zlib packages
diff --git a/zlib.3 b/zlib.3
index 7dbae94..d6922c4 100644
--- a/zlib.3
+++ b/zlib.3
@@ -1,4 +1,4 @@
-.TH ZLIB 3 "xx Feb 2026"
+.TH ZLIB 3 "4 Nov 2026"
 .SH NAME
 zlib \- compression/decompression library
 .SH SYNOPSIS
@@ -105,7 +105,7 @@ before asking for help.
 Send questions and/or comments to zlib@gzip.org,
 or (for the Windows DLL version) to Gilles Vollant (info@winimage.com).
 .SH AUTHORS AND LICENSE
-Version 1.3.2.1
+Version 1.4
 .LP
 Copyright (C) 1995-2026 Jean-loup Gailly and Mark Adler
 .LP
diff --git a/zlib.3.pdf b/zlib.3.pdf
index 0ec7c6a..a6e6c41 100644
Binary files a/zlib.3.pdf and b/zlib.3.pdf differ
diff --git a/zlib.h b/zlib.h
index 880bc44..c7e50b8 100644
--- a/zlib.h
+++ b/zlib.h
@@ -1,5 +1,5 @@
 /* zlib.h -- interface of the 'zlib' general purpose compression library
-  version 1.3.2.1, February xxth, 2026
+  version 1.4, November 4th, 2026

   Copyright (C) 1995-2026 Jean-loup Gailly and Mark Adler

@@ -41,12 +41,12 @@
 extern "C" {
 #endif

-#define ZLIB_VERSION "1.3.2.1-motley"
-#define ZLIB_VERNUM 0x1321
+#define ZLIB_VERSION "1.4"
+#define ZLIB_VERNUM 0x1400
 #define ZLIB_VER_MAJOR 1
-#define ZLIB_VER_MINOR 3
-#define ZLIB_VER_REVISION 2
-#define ZLIB_VER_SUBREVISION 1
+#define ZLIB_VER_MINOR 4
+#define ZLIB_VER_REVISION 0
+#define ZLIB_VER_SUBREVISION 0

 /*
     The 'zlib' compression library provides in-memory compression and