zlib 1.3.1
diff --git a/CMakeLists.txt b/CMakeLists.txt
index c053a95..15ceebe 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -3,7 +3,7 @@
 
 project(zlib C)
 
-set(VERSION "1.3.0.1")
+set(VERSION "1.3.1")
 
 option(ZLIB_BUILD_EXAMPLES "Enable Zlib Examples" ON)
 
diff --git a/ChangeLog b/ChangeLog
index dfd6524..b801a10 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,8 +1,15 @@
 
                 ChangeLog file for zlib
 
-Changes in 1.3.0.1 (xx Aug 2023)
-- 
+Changes in 1.3.1 (22 Jan 2024)
+- Reject overflows of zip header fields in minizip
+- Fix bug in inflateSync() for data held in bit buffer
+- Add LIT_MEM define to use more memory for a small deflate speedup
+- Fix decision on the emission of Zip64 end records in minizip
+- Add bounds checking to ERR_MSG() macro, used by zError()
+- Neutralize zip file traversal attacks in miniunz
+- Fix a bug in ZLIB_DEBUG compiles in check_match()
+- Various portability and appearance improvements
 
 Changes in 1.3 (18 Aug 2023)
 - Remove K&R function definitions and zlib2ansi
diff --git a/Makefile.in b/Makefile.in
index 7200c96..cb8b00a 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -1,5 +1,5 @@
 # Makefile for zlib
-# Copyright (C) 1995-2017 Jean-loup Gailly, Mark Adler
+# Copyright (C) 1995-2024 Jean-loup Gailly, Mark Adler
 # For conditions of distribution and use, see copyright notice in zlib.h
 
 # To compile and test, type:
@@ -28,7 +28,7 @@
 
 STATICLIB=libz.a
 SHAREDLIB=libz.so
-SHAREDLIBV=libz.so.1.3.0.1
+SHAREDLIBV=libz.so.1.3.1
 SHAREDLIBM=libz.so.1
 LIBS=$(STATICLIB) $(SHAREDLIBV)
 
diff --git a/README b/README
index 20f7064..c5f9175 100644
--- a/README
+++ b/README
@@ -1,6 +1,6 @@
 ZLIB DATA COMPRESSION LIBRARY
 
-zlib 1.3.0.1 is a general purpose data compression library.  All the code is
+zlib 1.3.1 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
 http://tools.ietf.org/html/rfc1950 (zlib format), rfc1951 (deflate format) and
@@ -31,7 +31,7 @@
 issue of Dr.  Dobb's Journal; a copy of the article is available at
 https://marknelson.us/posts/1997/01/01/zlib-engine.html .
 
-The changes made in version 1.3.0.1 are documented in the file ChangeLog.
+The changes made in version 1.3.1 are documented in the file ChangeLog.
 
 Unsupported third party contributions are provided in directory contrib/ .
 
@@ -83,7 +83,7 @@
 
 Copyright notice:
 
- (C) 1995-2023 Jean-loup Gailly and Mark Adler
+ (C) 1995-2024 Jean-loup Gailly and Mark Adler
 
   This software is provided 'as-is', without any express or implied
   warranty.  In no event will the authors be held liable for any damages
diff --git a/contrib/delphi/ZLib.pas b/contrib/delphi/ZLib.pas
index 814ffa6..93fa4c9 100644
--- a/contrib/delphi/ZLib.pas
+++ b/contrib/delphi/ZLib.pas
@@ -152,7 +152,7 @@
   const OutBuf: Pointer; BufSize: Integer);
 
 const
-  zlib_version = '1.3.0';
+  zlib_version = '1.3.1';
 
 type
   EZlibError = class(Exception);
diff --git a/contrib/dotzlib/DotZLib/UnitTests.cs b/contrib/dotzlib/DotZLib/UnitTests.cs
index c5fce22..d4f0980 100644
--- a/contrib/dotzlib/DotZLib/UnitTests.cs
+++ b/contrib/dotzlib/DotZLib/UnitTests.cs
@@ -156,7 +156,7 @@
         public void Info_Version()

         {

             Info info = new Info();

-            Assert.AreEqual("1.3.0", Info.Version);

+            Assert.AreEqual("1.3.1", 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 23f3050..ac707ed 100644
--- a/contrib/infback9/inftree9.c
+++ b/contrib/infback9/inftree9.c
@@ -1,5 +1,5 @@
 /* inftree9.c -- generate Huffman trees for efficient decoding
- * Copyright (C) 1995-2023 Mark Adler
+ * Copyright (C) 1995-2024 Mark Adler
  * For conditions of distribution and use, see copyright notice in zlib.h
  */
 
@@ -9,7 +9,7 @@
 #define MAXBITS 15
 
 const char inflate9_copyright[] =
-   " inflate9 1.3.0.1 Copyright 1995-2023 Mark Adler ";
+   " inflate9 1.3.1 Copyright 1995-2024 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 @@
     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, 70, 200};
+        133, 133, 133, 133, 144, 203, 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 cdfee49..15ec917 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.0.1], [bugzilla.redhat.com])
+AC_INIT([minizip], [1.3.1], [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 b72cbb6..68627f0 100644
--- a/contrib/nuget/nuget.csproj
+++ b/contrib/nuget/nuget.csproj
@@ -6,8 +6,8 @@
     <PackageId Condition="$([MSBuild]::IsOSPlatform('Windows'))">$(PackageId).win</PackageId>
     <PackageId Condition="$([MSBuild]::IsOSPlatform('Linux'))">$(PackageId).linux</PackageId>
     <PackageId Condition="$([MSBuild]::IsOSPlatform('OSX'))">$(PackageId).osx</PackageId>
-    <Copyright>(C) 1995-2023 Jean-loup Gailly and Mark Adler</Copyright>
-    <version>1.3.0.1</version>
+    <Copyright>(C) 1995-2024 Jean-loup Gailly and Mark Adler</Copyright>
+    <version>1.3.1</version>
     <PackageDescription>NuGet Package for consuming native builds of zlib into .NET without complexity.</PackageDescription>
     <!--
         Warns about not having any lib or ref assemblies (.NET Assemblies) in those directories.
diff --git a/contrib/pascal/zlibpas.pas b/contrib/pascal/zlibpas.pas
index 1b79ca0..0cf0e7b 100644
--- a/contrib/pascal/zlibpas.pas
+++ b/contrib/pascal/zlibpas.pas
@@ -10,7 +10,7 @@
 interface
 
 const
-  ZLIB_VERSION = '1.3.0.1';
+  ZLIB_VERSION = '1.3.1';
   ZLIB_VERNUM  = $12a0;
 
 type
diff --git a/contrib/vstudio/readme.txt b/contrib/vstudio/readme.txt
index a5000ae..061bbc0 100644
--- a/contrib/vstudio/readme.txt
+++ b/contrib/vstudio/readme.txt
@@ -1,4 +1,4 @@
-Building instructions for the DLL versions of Zlib 1.3.0.1
+Building instructions for the DLL versions of Zlib 1.3.1
 ========================================================
 
 This directory contains projects that build zlib and minizip using
diff --git a/contrib/vstudio/vc10/zlib.rc b/contrib/vstudio/vc10/zlib.rc
index 75b9283..856bd11 100644
--- a/contrib/vstudio/vc10/zlib.rc
+++ b/contrib/vstudio/vc10/zlib.rc
@@ -2,8 +2,8 @@
 

 #define IDR_VERSION1  1

 IDR_VERSION1	VERSIONINFO	MOVEABLE IMPURE LOADONCALL DISCARDABLE

-  FILEVERSION	 1, 3, 0, 1

-  PRODUCTVERSION 1, 3, 0, 1

+  FILEVERSION	 1, 3, 1, 0

+  PRODUCTVERSION 1, 3, 1, 0

   FILEFLAGSMASK	VS_FFI_FILEFLAGSMASK

   FILEFLAGS	0

   FILEOS	VOS_DOS_WINDOWS32

@@ -17,12 +17,12 @@
 

     BEGIN

       VALUE "FileDescription", "zlib data compression and ZIP file I/O library\0"

-      VALUE "FileVersion",	"1.3.0.1\0"

+      VALUE "FileVersion",	"1.3.1\0"

       VALUE "InternalName",	"zlib\0"

       VALUE "OriginalFilename",	"zlibwapi.dll\0"

       VALUE "ProductName",	"ZLib.DLL\0"

       VALUE "Comments","DLL support by Alessandro Iacopetti & Gilles Vollant\0"

-      VALUE "LegalCopyright", "(C) 1995-2023 Jean-loup Gailly & Mark Adler\0"

+      VALUE "LegalCopyright", "(C) 1995-2024 Jean-loup Gailly & Mark Adler\0"

     END

   END

   BLOCK "VarFileInfo"

diff --git a/contrib/vstudio/vc10/zlibvc.def b/contrib/vstudio/vc10/zlibvc.def
index f28aa6c..3234a02 100644
--- a/contrib/vstudio/vc10/zlibvc.def
+++ b/contrib/vstudio/vc10/zlibvc.def
@@ -1,7 +1,7 @@
 LIBRARY

 ; zlib data compression and ZIP file I/O library

 

-VERSION		1.3

+VERSION		1.3.1

 

 EXPORTS

         adler32                                  @1

diff --git a/contrib/vstudio/vc11/zlib.rc b/contrib/vstudio/vc11/zlib.rc
index 75b9283..856bd11 100644
--- a/contrib/vstudio/vc11/zlib.rc
+++ b/contrib/vstudio/vc11/zlib.rc
@@ -2,8 +2,8 @@
 

 #define IDR_VERSION1  1

 IDR_VERSION1	VERSIONINFO	MOVEABLE IMPURE LOADONCALL DISCARDABLE

-  FILEVERSION	 1, 3, 0, 1

-  PRODUCTVERSION 1, 3, 0, 1

+  FILEVERSION	 1, 3, 1, 0

+  PRODUCTVERSION 1, 3, 1, 0

   FILEFLAGSMASK	VS_FFI_FILEFLAGSMASK

   FILEFLAGS	0

   FILEOS	VOS_DOS_WINDOWS32

@@ -17,12 +17,12 @@
 

     BEGIN

       VALUE "FileDescription", "zlib data compression and ZIP file I/O library\0"

-      VALUE "FileVersion",	"1.3.0.1\0"

+      VALUE "FileVersion",	"1.3.1\0"

       VALUE "InternalName",	"zlib\0"

       VALUE "OriginalFilename",	"zlibwapi.dll\0"

       VALUE "ProductName",	"ZLib.DLL\0"

       VALUE "Comments","DLL support by Alessandro Iacopetti & Gilles Vollant\0"

-      VALUE "LegalCopyright", "(C) 1995-2023 Jean-loup Gailly & Mark Adler\0"

+      VALUE "LegalCopyright", "(C) 1995-2024 Jean-loup Gailly & Mark Adler\0"

     END

   END

   BLOCK "VarFileInfo"

diff --git a/contrib/vstudio/vc11/zlibvc.def b/contrib/vstudio/vc11/zlibvc.def
index f28aa6c..3234a02 100644
--- a/contrib/vstudio/vc11/zlibvc.def
+++ b/contrib/vstudio/vc11/zlibvc.def
@@ -1,7 +1,7 @@
 LIBRARY

 ; zlib data compression and ZIP file I/O library

 

-VERSION		1.3

+VERSION		1.3.1

 

 EXPORTS

         adler32                                  @1

diff --git a/contrib/vstudio/vc12/zlib.rc b/contrib/vstudio/vc12/zlib.rc
index e54fac4..a55f341 100644
--- a/contrib/vstudio/vc12/zlib.rc
+++ b/contrib/vstudio/vc12/zlib.rc
@@ -2,8 +2,8 @@
 
 #define IDR_VERSION1  1
 IDR_VERSION1	VERSIONINFO	MOVEABLE IMPURE LOADONCALL DISCARDABLE
-  FILEVERSION	 1, 3, 0, 1
-  PRODUCTVERSION 1, 3, 0, 1
+  FILEVERSION	 1, 3, 1, 0
+  PRODUCTVERSION 1, 3, 1, 0
   FILEFLAGSMASK	VS_FFI_FILEFLAGSMASK
   FILEFLAGS	0
   FILEOS	VOS_DOS_WINDOWS32
@@ -17,12 +17,12 @@
 
     BEGIN
       VALUE "FileDescription", "zlib data compression and ZIP file I/O library\0"
-      VALUE "FileVersion",	"1.3.0.1\0"
+      VALUE "FileVersion",	"1.3.1\0"
       VALUE "InternalName",	"zlib\0"
       VALUE "OriginalFilename",	"zlibwapi.dll\0"
       VALUE "ProductName",	"ZLib.DLL\0"
       VALUE "Comments","DLL support by Alessandro Iacopetti & Gilles Vollant\0"
-      VALUE "LegalCopyright", "(C) 1995-2023 Jean-loup Gailly & Mark Adler\0"
+      VALUE "LegalCopyright", "(C) 1995-2024 Jean-loup Gailly & Mark Adler\0"
     END
   END
   BLOCK "VarFileInfo"
diff --git a/contrib/vstudio/vc12/zlibvc.def b/contrib/vstudio/vc12/zlibvc.def
index f28aa6c..3234a02 100644
--- a/contrib/vstudio/vc12/zlibvc.def
+++ b/contrib/vstudio/vc12/zlibvc.def
@@ -1,7 +1,7 @@
 LIBRARY

 ; zlib data compression and ZIP file I/O library

 

-VERSION		1.3

+VERSION		1.3.1

 

 EXPORTS

         adler32                                  @1

diff --git a/contrib/vstudio/vc14/zlib.rc b/contrib/vstudio/vc14/zlib.rc
index e54fac4..a55f341 100644
--- a/contrib/vstudio/vc14/zlib.rc
+++ b/contrib/vstudio/vc14/zlib.rc
@@ -2,8 +2,8 @@
 
 #define IDR_VERSION1  1
 IDR_VERSION1	VERSIONINFO	MOVEABLE IMPURE LOADONCALL DISCARDABLE
-  FILEVERSION	 1, 3, 0, 1
-  PRODUCTVERSION 1, 3, 0, 1
+  FILEVERSION	 1, 3, 1, 0
+  PRODUCTVERSION 1, 3, 1, 0
   FILEFLAGSMASK	VS_FFI_FILEFLAGSMASK
   FILEFLAGS	0
   FILEOS	VOS_DOS_WINDOWS32
@@ -17,12 +17,12 @@
 
     BEGIN
       VALUE "FileDescription", "zlib data compression and ZIP file I/O library\0"
-      VALUE "FileVersion",	"1.3.0.1\0"
+      VALUE "FileVersion",	"1.3.1\0"
       VALUE "InternalName",	"zlib\0"
       VALUE "OriginalFilename",	"zlibwapi.dll\0"
       VALUE "ProductName",	"ZLib.DLL\0"
       VALUE "Comments","DLL support by Alessandro Iacopetti & Gilles Vollant\0"
-      VALUE "LegalCopyright", "(C) 1995-2023 Jean-loup Gailly & Mark Adler\0"
+      VALUE "LegalCopyright", "(C) 1995-2024 Jean-loup Gailly & Mark Adler\0"
     END
   END
   BLOCK "VarFileInfo"
diff --git a/contrib/vstudio/vc14/zlibvc.def b/contrib/vstudio/vc14/zlibvc.def
index f28aa6c..3234a02 100644
--- a/contrib/vstudio/vc14/zlibvc.def
+++ b/contrib/vstudio/vc14/zlibvc.def
@@ -1,7 +1,7 @@
 LIBRARY

 ; zlib data compression and ZIP file I/O library

 

-VERSION		1.3

+VERSION		1.3.1

 

 EXPORTS

         adler32                                  @1

diff --git a/contrib/vstudio/vc17/zlib.rc b/contrib/vstudio/vc17/zlib.rc
index e54fac4..a55f341 100644
--- a/contrib/vstudio/vc17/zlib.rc
+++ b/contrib/vstudio/vc17/zlib.rc
@@ -2,8 +2,8 @@
 
 #define IDR_VERSION1  1
 IDR_VERSION1	VERSIONINFO	MOVEABLE IMPURE LOADONCALL DISCARDABLE
-  FILEVERSION	 1, 3, 0, 1
-  PRODUCTVERSION 1, 3, 0, 1
+  FILEVERSION	 1, 3, 1, 0
+  PRODUCTVERSION 1, 3, 1, 0
   FILEFLAGSMASK	VS_FFI_FILEFLAGSMASK
   FILEFLAGS	0
   FILEOS	VOS_DOS_WINDOWS32
@@ -17,12 +17,12 @@
 
     BEGIN
       VALUE "FileDescription", "zlib data compression and ZIP file I/O library\0"
-      VALUE "FileVersion",	"1.3.0.1\0"
+      VALUE "FileVersion",	"1.3.1\0"
       VALUE "InternalName",	"zlib\0"
       VALUE "OriginalFilename",	"zlibwapi.dll\0"
       VALUE "ProductName",	"ZLib.DLL\0"
       VALUE "Comments","DLL support by Alessandro Iacopetti & Gilles Vollant\0"
-      VALUE "LegalCopyright", "(C) 1995-2023 Jean-loup Gailly & Mark Adler\0"
+      VALUE "LegalCopyright", "(C) 1995-2024 Jean-loup Gailly & Mark Adler\0"
     END
   END
   BLOCK "VarFileInfo"
diff --git a/contrib/vstudio/vc17/zlibvc.def b/contrib/vstudio/vc17/zlibvc.def
index c349235..53947cc 100644
--- a/contrib/vstudio/vc17/zlibvc.def
+++ b/contrib/vstudio/vc17/zlibvc.def
@@ -1,7 +1,7 @@
 LIBRARY
 ; zlib data compression and ZIP file I/O library
 
-VERSION		1.3
+VERSION		1.3.1
 
 EXPORTS
         adler32                                  @1
diff --git a/contrib/vstudio/vc9/zlib.rc b/contrib/vstudio/vc9/zlib.rc
index 75b9283..856bd11 100644
--- a/contrib/vstudio/vc9/zlib.rc
+++ b/contrib/vstudio/vc9/zlib.rc
@@ -2,8 +2,8 @@
 

 #define IDR_VERSION1  1

 IDR_VERSION1	VERSIONINFO	MOVEABLE IMPURE LOADONCALL DISCARDABLE

-  FILEVERSION	 1, 3, 0, 1

-  PRODUCTVERSION 1, 3, 0, 1

+  FILEVERSION	 1, 3, 1, 0

+  PRODUCTVERSION 1, 3, 1, 0

   FILEFLAGSMASK	VS_FFI_FILEFLAGSMASK

   FILEFLAGS	0

   FILEOS	VOS_DOS_WINDOWS32

@@ -17,12 +17,12 @@
 

     BEGIN

       VALUE "FileDescription", "zlib data compression and ZIP file I/O library\0"

-      VALUE "FileVersion",	"1.3.0.1\0"

+      VALUE "FileVersion",	"1.3.1\0"

       VALUE "InternalName",	"zlib\0"

       VALUE "OriginalFilename",	"zlibwapi.dll\0"

       VALUE "ProductName",	"ZLib.DLL\0"

       VALUE "Comments","DLL support by Alessandro Iacopetti & Gilles Vollant\0"

-      VALUE "LegalCopyright", "(C) 1995-2023 Jean-loup Gailly & Mark Adler\0"

+      VALUE "LegalCopyright", "(C) 1995-2024 Jean-loup Gailly & Mark Adler\0"

     END

   END

   BLOCK "VarFileInfo"

diff --git a/contrib/vstudio/vc9/zlibvc.def b/contrib/vstudio/vc9/zlibvc.def
index f28aa6c..3234a02 100644
--- a/contrib/vstudio/vc9/zlibvc.def
+++ b/contrib/vstudio/vc9/zlibvc.def
@@ -1,7 +1,7 @@
 LIBRARY

 ; zlib data compression and ZIP file I/O library

 

-VERSION		1.3

+VERSION		1.3.1

 

 EXPORTS

         adler32                                  @1

diff --git a/deflate.c b/deflate.c
index d73a73e..012ea81 100644
--- a/deflate.c
+++ b/deflate.c
@@ -1,5 +1,5 @@
 /* deflate.c -- compress data using the deflation algorithm
- * Copyright (C) 1995-2023 Jean-loup Gailly and Mark Adler
+ * Copyright (C) 1995-2024 Jean-loup Gailly and Mark Adler
  * For conditions of distribution and use, see copyright notice in zlib.h
  */
 
@@ -52,7 +52,7 @@
 #include "deflate.h"
 
 const char deflate_copyright[] =
-   " deflate 1.3.0.1 Copyright 1995-2023 Jean-loup Gailly and Mark Adler ";
+   " deflate 1.3.1 Copyright 1995-2024 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/deflate.h b/deflate.h
index 854b156..300c6ad 100644
--- a/deflate.h
+++ b/deflate.h
@@ -1,5 +1,5 @@
 /* deflate.h -- internal compression state
- * Copyright (C) 1995-2018 Jean-loup Gailly
+ * Copyright (C) 1995-2024 Jean-loup Gailly
  * For conditions of distribution and use, see copyright notice in zlib.h
  */
 
diff --git a/gzguts.h b/gzguts.h
index adc2b34..eba7208 100644
--- a/gzguts.h
+++ b/gzguts.h
@@ -1,5 +1,5 @@
 /* gzguts.h -- zlib internal header definitions for gz* operations
- * Copyright (C) 2004-2019 Mark Adler
+ * Copyright (C) 2004-2024 Mark Adler
  * For conditions of distribution and use, see copyright notice in zlib.h
  */
 
diff --git a/gzlib.c b/gzlib.c
index 9c103db..983153c 100644
--- a/gzlib.c
+++ b/gzlib.c
@@ -1,5 +1,5 @@
 /* gzlib.c -- zlib functions common to reading and writing gzip files
- * Copyright (C) 2004-2019 Mark Adler
+ * Copyright (C) 2004-2024 Mark Adler
  * For conditions of distribution and use, see copyright notice in zlib.h
  */
 
diff --git a/inftrees.c b/inftrees.c
index 73d5a77..98cfe16 100644
--- a/inftrees.c
+++ b/inftrees.c
@@ -1,5 +1,5 @@
 /* inftrees.c -- generate Huffman trees for efficient decoding
- * Copyright (C) 1995-2023 Mark Adler
+ * Copyright (C) 1995-2024 Mark Adler
  * For conditions of distribution and use, see copyright notice in zlib.h
  */
 
@@ -9,7 +9,7 @@
 #define MAXBITS 15
 
 const char inflate_copyright[] =
-   " inflate 1.3.0.1 Copyright 1995-2023 Mark Adler ";
+   " inflate 1.3.1 Copyright 1995-2024 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
@@ -57,7 +57,7 @@
         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, 70, 200};
+        19, 19, 19, 19, 20, 20, 20, 20, 21, 21, 21, 21, 16, 203, 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 33492f2..30ed5a1 100644
--- a/os400/README400
+++ b/os400/README400
@@ -1,4 +1,4 @@
-        ZLIB version 1.3.0.1 for OS/400 installation instructions
+        ZLIB version 1.3.1 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/zlib.inc b/os400/zlib.inc
index 88b243a..744729a 100644
--- a/os400/zlib.inc
+++ b/os400/zlib.inc
@@ -1,7 +1,7 @@
       *  ZLIB.INC - Interface to the general purpose compression library
       *
       *  ILE RPG400 version by Patrick Monnerat, DATASPHERE.
-      *  Version 1.3.0.1
+      *  Version 1.3.1
       *
       *
       *  WARNING:
@@ -22,14 +22,14 @@
       *
       *  Versioning information.
       *
-     D ZLIB_VERSION    C                   '1.3.0.1'
+     D ZLIB_VERSION    C                   '1.3.1'
      D ZLIB_VERNUM     C                   X'12a0'
      D ZLIB_VER_MAJOR  C                   1
      D ZLIB_VER_MINOR  C                   3
      D ZLIB_VER_REVISION...
-     D                 C                   0
-     D ZLIB_VER_SUBREVISION...
      D                 C                   1
+     D ZLIB_VER_SUBREVISION...
+     D                 C                   0
       *
       *  Other equates.
       *
diff --git a/qnx/package.qpg b/qnx/package.qpg
index 88343ad..4877e0e 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.0.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.0.1"/>
-         <QPG:Add file="libz.so.1" install="/opt/lib/" filetype="symlink" linkto="libz.so.1.3.0.1"/>
-         <QPG:Add file="../libz.so.1.3.0.1" install="/opt/lib/" component="slib"/>
+         <QPG:Add file="../libz.so.1.3.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.1"/>
+         <QPG:Add file="libz.so.1" install="/opt/lib/" filetype="symlink" linkto="libz.so.1.3.1"/>
+         <QPG:Add file="../libz.so.1.3.1" install="/opt/lib/" component="slib"/>
       </QPG:Files>
 
       <QPG:PackageFilter>
@@ -63,7 +63,7 @@
             </QPM:ProductDescription>
 
             <QPM:ReleaseDescription>
-               <QPM:ReleaseVersion>1.3.0.1</QPM:ReleaseVersion>
+               <QPM:ReleaseVersion>1.3.1</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 8bac3f7..930b00b 100644
--- a/treebuild.xml
+++ b/treebuild.xml
@@ -1,6 +1,6 @@
 <?xml version="1.0" ?>
-<package name="zlib" version="1.3.0.1">
-    <library name="zlib" dlversion="1.3.0.1" dlname="z">
+<package name="zlib" version="1.3.1">
+    <library name="zlib" dlversion="1.3.1" dlname="z">
 	<property name="description"> zip compression library </property>
 	<property name="include-target-dir" value="$(@PACKAGE/install-includedir)" />
 
diff --git a/trees.c b/trees.c
index e816d32..6a523ef 100644
--- a/trees.c
+++ b/trees.c
@@ -1,5 +1,5 @@
 /* trees.c -- output deflated data using Huffman coding
- * Copyright (C) 1995-2021 Jean-loup Gailly
+ * Copyright (C) 1995-2024 Jean-loup Gailly
  * detect_data_type() function provided freely by Cosmin Truta, 2006
  * For conditions of distribution and use, see copyright notice in zlib.h
  */
diff --git a/win32/README-WIN32.txt b/win32/README-WIN32.txt
index 600fa3f..14e6398 100644
--- a/win32/README-WIN32.txt
+++ b/win32/README-WIN32.txt
@@ -1,6 +1,6 @@
 ZLIB DATA COMPRESSION LIBRARY
 
-zlib 1.3.0.1 is a general purpose data compression library.  All the code is
+zlib 1.3.1 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
 http://www.ietf.org/rfc/rfc1950.txt (zlib format), rfc1951.txt (deflate format)
@@ -22,7 +22,7 @@
 
 Manifest:
 
-The package zlib-1.3.0.1-win32-x86.zip will contain the following files:
+The package zlib-1.3.1-win32-x86.zip will contain the following files:
 
   README-WIN32.txt This document
   ChangeLog        Changes since previous zlib packages
diff --git a/zconf.h b/zconf.h
index 9baa952..62adc8d 100644
--- a/zconf.h
+++ b/zconf.h
@@ -1,5 +1,5 @@
 /* zconf.h -- configuration of the zlib compression library
- * Copyright (C) 1995-2016 Jean-loup Gailly, Mark Adler
+ * Copyright (C) 1995-2024 Jean-loup Gailly, Mark Adler
  * For conditions of distribution and use, see copyright notice in zlib.h
  */
 
diff --git a/zconf.h.cmakein b/zconf.h.cmakein
index 51558ce..0abe3bc 100644
--- a/zconf.h.cmakein
+++ b/zconf.h.cmakein
@@ -1,5 +1,5 @@
 /* zconf.h -- configuration of the zlib compression library
- * Copyright (C) 1995-2016 Jean-loup Gailly, Mark Adler
+ * Copyright (C) 1995-2024 Jean-loup Gailly, Mark Adler
  * For conditions of distribution and use, see copyright notice in zlib.h
  */
 
diff --git a/zconf.h.in b/zconf.h.in
index 9baa952..62adc8d 100644
--- a/zconf.h.in
+++ b/zconf.h.in
@@ -1,5 +1,5 @@
 /* zconf.h -- configuration of the zlib compression library
- * Copyright (C) 1995-2016 Jean-loup Gailly, Mark Adler
+ * Copyright (C) 1995-2024 Jean-loup Gailly, Mark Adler
  * For conditions of distribution and use, see copyright notice in zlib.h
  */
 
diff --git a/zlib.3 b/zlib.3
index ca30d07..c716020 100644
--- a/zlib.3
+++ b/zlib.3
@@ -1,4 +1,4 @@
-.TH ZLIB 3 "xx Aug 2023"
+.TH ZLIB 3 "22 Jan 2024"
 .SH NAME
 zlib \- compression/decompression library
 .SH SYNOPSIS
@@ -105,9 +105,9 @@
 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.0.1
+Version 1.3.1
 .LP
-Copyright (C) 1995-2023 Jean-loup Gailly and Mark Adler
+Copyright (C) 1995-2024 Jean-loup Gailly and Mark Adler
 .LP
 This software is provided 'as-is', without any express or implied
 warranty.  In no event will the authors be held liable for any damages
diff --git a/zlib.3.pdf b/zlib.3.pdf
index da12d37..b224532 100644
--- a/zlib.3.pdf
+++ b/zlib.3.pdf
Binary files differ
diff --git a/zlib.h b/zlib.h
index 39991a4..8d4b932 100644
--- a/zlib.h
+++ b/zlib.h
@@ -1,7 +1,7 @@
 /* zlib.h -- interface of the 'zlib' general purpose compression library
-  version 1.3.0.1, August xxth, 2023
+  version 1.3.1, January 22nd, 2024
 
-  Copyright (C) 1995-2023 Jean-loup Gailly and Mark Adler
+  Copyright (C) 1995-2024 Jean-loup Gailly and Mark Adler
 
   This software is provided 'as-is', without any express or implied
   warranty.  In no event will the authors be held liable for any damages
@@ -37,12 +37,12 @@
 extern "C" {
 #endif
 
-#define ZLIB_VERSION "1.3.0.1-motley"
-#define ZLIB_VERNUM 0x1301
+#define ZLIB_VERSION "1.3.1"
+#define ZLIB_VERNUM 0x1310
 #define ZLIB_VER_MAJOR 1
 #define ZLIB_VER_MINOR 3
-#define ZLIB_VER_REVISION 0
-#define ZLIB_VER_SUBREVISION 1
+#define ZLIB_VER_REVISION 1
+#define ZLIB_VER_SUBREVISION 0
 
 /*
     The 'zlib' compression library provides in-memory compression and
diff --git a/zutil.h b/zutil.h
index bb513cb..48dd7fe 100644
--- a/zutil.h
+++ b/zutil.h
@@ -1,5 +1,5 @@
 /* zutil.h -- internal interface and configuration of the compression library
- * Copyright (C) 1995-2022 Jean-loup Gailly, Mark Adler
+ * Copyright (C) 1995-2024 Jean-loup Gailly, Mark Adler
  * For conditions of distribution and use, see copyright notice in zlib.h
  */