diff --git a/file-5.43-python.patch b/file-5.43-python.patch new file mode 100644 index 0000000..a8fcfd5 --- /dev/null +++ b/file-5.43-python.patch @@ -0,0 +1,20 @@ +diff --git a/python/magic.py b/python/magic.py +index a528cbc..eb153b0 100644 +--- a/python/magic.py ++++ b/python/magic.py +@@ -111,12 +111,14 @@ _errno.argtypes = [magic_t] + class Magic(object): + def __init__(self, ms): + self._magic_t = ms ++ self._close = _close + + def close(self): + """ + Closes the magic database and deallocates any resources used. + """ +- _close(self._magic_t) ++ if self._close: ++ self._close(self._magic_t) + + @staticmethod + def __tostr(s): diff --git a/file.spec b/file.spec index 11a2c90..b2972f1 100644 --- a/file.spec +++ b/file.spec @@ -15,7 +15,7 @@ Summary: Utility for determining file types Name: file Version: 5.39 -Release: 16%{?dist} +Release: 17%{?dist} License: BSD Source0: http://ftp.astron.com/pub/file/file-%{version}.tar.gz @@ -62,6 +62,8 @@ Patch16: file-5.39-wasm-magic.patch Patch17: file-5.41-python-magic-threads.patch # Upstream commit 497aabb29cd08d2a5aeb63e45798d65fcbe03502 (#5733) Patch18: file-5.42-cve-strlcpy.patch +# Upstream commit 141dde1fe573e6c42800d12affb94c927b44da3e +Patch19: file-5.43-python.patch URL: https://www.darwinsys.com/file/ Requires: file-libs%{?_isa} = %{version}-%{release} @@ -241,6 +243,10 @@ cd %{py3dir} %endif %changelog +* Mon Feb 23 2026 Vincent Mihalkovic - 5.39-17 +- Fix TypeError: 'NoneType' object is not callable in magic.close() + Resolves: RHEL-136523 + * Thu Nov 23 2023 Vincent Mihalkovic - 5.39-16 - Fix stack-based buffer over-read in file_copystr() (CVE-2022-48554)