[packages/libfetch] Rel 2. Fix FTP PASV reply out-of-bounds read.

arekm arekm at pld-linux.org
Sat Nov 28 17:45:02 CET 2026


commit efcecf0a788f2bf2382b4eb09a08d1cbb6d25b02
Author: Arkadiusz Miśkiewicz <arekm at maven.pl>
Date:   Fri Nov 27 16:13:40 2026 +0100

    Rel 2. Fix FTP PASV reply out-of-bounds read.
    
    Fixes CVE-2021-36159.

 libfetch-CVE-2021-36159.patch | 17 +++++++++++++++++
 libfetch.spec                 |  4 +++-
 2 files changed, 20 insertions(+), 1 deletion(-)
---
diff --git a/libfetch.spec b/libfetch.spec
index 97282ee..383ce39 100644
--- a/libfetch.spec
+++ b/libfetch.spec
@@ -2,7 +2,7 @@ Summary:	High-level interface for retreiving and uploading files using Uniform R
 Summary(pl.UTF-8):	Wysokopoziomowy interfejs do pobierania i przesyłania plików z użyciem URI
 Name:		libfetch
 Version:	2.33
-Release:	1
+Release:	2
 License:	BSD
 Group:		Libraries
 Source0:	https://sources.archlinux.org/other/libfetch/%{name}-%{version}.tar.gz
@@ -10,6 +10,7 @@ Source0:	https://sources.archlinux.org/other/libfetch/%{name}-%{version}.tar.gz
 # https://gitlab.alpinelinux.org/alpine/aports/-/raw/v3.8.5/main/libfetch/Makefile?ref_type=tags&inline=false
 Source1:	libfetch-Makefile
 Patch0:		makefile-user-cflags.patch
+Patch1:		libfetch-CVE-2021-36159.patch
 URL:		https://cvsweb.netbsd.org/bsdweb.cgi/pkgsrc/net/libfetch/
 BuildRequires:	openssl-devel
 BuildRequires:	sed >= 4.0
@@ -51,6 +52,7 @@ Statyczna biblioteka libfetch.
 %setup -q
 cp -p %{SOURCE1} Makefile.linux
 %patch -P0 -p1
+%patch -P1 -p1
 
 %build
 %{__make} -f Makefile.linux \
diff --git a/libfetch-CVE-2021-36159.patch b/libfetch-CVE-2021-36159.patch
new file mode 100644
index 0000000..e553e9a
--- /dev/null
+++ b/libfetch-CVE-2021-36159.patch
@@ -0,0 +1,17 @@
+# CVE-2021-36159: PASV reply parsing reads past the string end
+# https://cgit.freebsd.org/src/commit/?id=64ae2f785e0672286901c15045a24cbc533538d3
+--- libfetch-2.33.orig/ftp.c
++++ libfetch-2.33/ftp.c
+@@ -758,8 +758,11 @@
+ 				goto ouch;
+ 			}
+ 			l = (e == FTP_PASSIVE_MODE ? 6 : 21);
+-			for (i = 0; *p && i < l; i++, p++)
++			for (i = 0; *p && i < l; i++, p++) {
+ 				addr[i] = strtol(p, &p, 10);
++				if (*p == '\0' && i < l - 1)
++					break;
++			}
+ 			if (i < l) {
+ 				e = FTP_PROTOCOL_ERROR;
+ 				goto ouch;
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/libfetch.git/commitdiff/efcecf0a788f2bf2382b4eb09a08d1cbb6d25b02



More information about the pld-cvs-commit mailing list