[packages/minidlna] - rel 4, add fixes from Fedora

baggins baggins at pld-linux.org
Mon Oct 19 10:30:34 CEST 2026


commit f30c237c79f7238141917fed1abd3cafb230e80b
Author: Jan Rękorajski <baggins at pld-linux.org>
Date:   Mon Oct 19 10:30:18 2026 +0200

    - rel 4, add fixes from Fedora

 0001-Add-compatibility-with-FFMPEG-7.0.patch |  38 +++++
 minidlna-1.3.0-select_use_after_free.patch   |  12 ++
 minidlna-CVE-2023-47430.patch                | 200 +++++++++++++++++++++++++++
 minidlna.spec                                |  13 +-
 4 files changed, 257 insertions(+), 6 deletions(-)
---
diff --git a/minidlna.spec b/minidlna.spec
index f0ca2e6..3dc10ce 100644
--- a/minidlna.spec
+++ b/minidlna.spec
@@ -5,7 +5,7 @@ Summary:	DLNA server software
 Summary(pl.UTF-8):	Oprogramowanie serwerowe DLNA
 Name:		minidlna
 Version:	1.3.3
-Release:	3
+Release:	4
 License:	GPL v2
 Group:		Networking/Daemons
 Source0:	http://downloads.sourceforge.net/minidlna/%{name}-%{version}.tar.gz
@@ -14,6 +14,9 @@ Source1:	%{name}.init
 Source2:	%{name}.service
 Source3:	%{name}.tmpfiles
 Patch0:		config.patch
+Patch1:		0001-Add-compatibility-with-FFMPEG-7.0.patch
+Patch2:		minidlna-1.3.0-select_use_after_free.patch
+Patch3:		minidlna-CVE-2023-47430.patch
 URL:		http://sourceforge.net/projects/minidlna/
 BuildRequires:	autoconf >= 2.50
 BuildRequires:	automake
@@ -45,13 +48,11 @@ którego celem jest pełna zgodność z klientami DLNA/UPnP-AV.
 %prep
 %setup -q
 %patch -P0 -p1
+%patch -P1 -p1
+%patch -P2 -p1
+%patch -P3 -p1
 
 %build
-%{__gettextize}
-%{__aclocal}
-%{__autoconf}
-%{__autoheader}
-%{__automake}
 export CFLAGS="%{rpmcflags} -fcommon"
 %configure \
 	--disable-silent-rules
diff --git a/0001-Add-compatibility-with-FFMPEG-7.0.patch b/0001-Add-compatibility-with-FFMPEG-7.0.patch
new file mode 100644
index 0000000..681509c
--- /dev/null
+++ b/0001-Add-compatibility-with-FFMPEG-7.0.patch
@@ -0,0 +1,38 @@
+From 243cf2dd27ebcaf4ef1093c79b96077378d52018 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Robert-Andr=C3=A9=20Mauchin?= <zebob.m at gmail.com>
+Date: Sat, 4 May 2024 18:36:58 +0200
+Subject: [PATCH] Add compatibility with FFMPEG 7.0
+
+channel_layout has been replaced with ch_layout
+---
+ libav.h | 6 ++++++
+ 1 file changed, 6 insertions(+)
+
+diff --git a/libav.h b/libav.h
+index b69752c..fae094b 100644
+--- a/libav.h
++++ b/libav.h
+@@ -117,6 +117,8 @@ typedef AVMetadataTag AVDictionaryEntry;
+ # endif
+ #endif
+ 
++#define HAVE_CH_LAYOUT (LIBAVUTIL_VERSION_INT >= ((57<<16)+(28<<8)+100))
++
+ static inline int
+ lav_open(AVFormatContext **ctx, const char *filename)
+ {
+@@ -174,7 +176,11 @@ lav_get_interlaced(AVStream *s)
+ #define lav_codec_tag(s) s->codecpar->codec_tag
+ #define lav_sample_rate(s) s->codecpar->sample_rate
+ #define lav_bit_rate(s) s->codecpar->bit_rate
++#if HAVE_CH_LAYOUT
++#define lav_channels(s) s->codecpar->ch_layout.nb_channels
++#else
+ #define lav_channels(s) s->codecpar->channels
++#endif
+ #define lav_width(s) s->codecpar->width
+ #define lav_height(s) s->codecpar->height
+ #define lav_profile(s) s->codecpar->profile
+-- 
+2.44.0
+
diff --git a/minidlna-1.3.0-select_use_after_free.patch b/minidlna-1.3.0-select_use_after_free.patch
new file mode 100644
index 0000000..6a29b08
--- /dev/null
+++ b/minidlna-1.3.0-select_use_after_free.patch
@@ -0,0 +1,12 @@
+fix potential use-after-free in child process
+diff -wpruN '--exclude=*.orig' a~/select.c a/select.c
+--- a~/select.c	1970-01-01 00:00:00
++++ a/select.c	1970-01-01 00:00:00
+@@ -83,6 +83,7 @@ select_fini(void)
+ 
+ 	free(events);
+ 	events = NULL;
++	nevents = 0;
+ }
+ 
+ static int
diff --git a/minidlna-CVE-2023-47430.patch b/minidlna-CVE-2023-47430.patch
new file mode 100644
index 0000000..5b7bdf9
--- /dev/null
+++ b/minidlna-CVE-2023-47430.patch
@@ -0,0 +1,200 @@
+diff -up minidlna-1.3.3/tivo_commands.c.orig minidlna-1.3.3/tivo_commands.c
+--- minidlna-1.3.3/tivo_commands.c.orig	2023-05-31 10:25:59.000000000 +0200
++++ minidlna-1.3.3/tivo_commands.c	2025-07-07 18:13:00.594971958 +0200
+@@ -435,8 +435,16 @@ SendContainer(struct upnphttp *h, const
+ 				}
+ 				if( strcasecmp(item, "Type") == 0 )
+ 				{
++					if (strlen(order)+5 < 96 && strlen(order2)+5 < 96)
++					{
+ 					strcat(order, "CLASS");
+ 					strcat(order2, "CLASS");
++					}
++					else
++					{
++						DPRINTF(E_INFO, L_TIVO, "Type order string too long [%s]\n", item);
++						goto unhandled_order;
++					}
+ 				}
+ 				else if( strcasecmp(item, "Title") == 0 )
+ 				{
+@@ -445,29 +453,61 @@ SendContainer(struct upnphttp *h, const
+ 					{
+ 						if( !title_state )
+ 						{
++							if (strlen(order)+4 < 96 && strlen(order2)+4 < 96)
++							{
+ 							strcat(order, "DISC");
+ 							strcat(order2, "DISC");
+ 							title_state = 1;
++							}
++							else
++							{
++								DPRINTF(E_INFO, L_TIVO, "Title order string too long [%s]\n", item);
++								goto unhandled_order;
++							}
+ 						}
+ 						else
+ 						{
++							if (strlen(order)+5 < 96 && strlen(order2)+5 < 96)
++							{
+ 							strcat(order, "TRACK");
+ 							strcat(order2, "TRACK");
+ 							title_state = 2;
++							}
++							else
++							{
++								DPRINTF(E_INFO, L_TIVO, "Title order string too long [%s]\n", item);
++								goto unhandled_order;
++							}
+ 						}
+ 					}
+ 					else
+ 					{
++						if (strlen(order)+5 < 96 && strlen(order2)+5 < 96)
++						{
+ 						strcat(order, "TITLE");
+ 						strcat(order2, "TITLE");
+ 						title_state = -1;
++						}
++						else
++						{
++							DPRINTF(E_INFO, L_TIVO, "Title order string too long [%s]\n", item);
++							goto unhandled_order;
++						}
+ 					}
+ 				}
+ 				else if( strcasecmp(item, "CreationDate") == 0 ||
+ 				         strcasecmp(item, "CaptureDate") == 0 )
+ 				{
++					if (strlen(order)+4 < 96 && strlen(order2)+4 < 96)
++					{
+ 					strcat(order, "DATE");
+ 					strcat(order2, "DATE");
++					}
++					else
++					{
++						DPRINTF(E_INFO, L_TIVO, "Date order string too long [%s]\n", item);
++						goto unhandled_order;
++					}
+ 				}
+ 				else
+ 				{
+@@ -477,39 +517,78 @@ SendContainer(struct upnphttp *h, const
+ 
+ 				if( reverse )
+ 				{
++					if (strlen(order)+5 < 96 && strlen(order2)+5 < 96)
++					{
+ 					strcat(order, " DESC");
+ 					if( itemCount >= 0 )
+ 						strcat(order2, " DESC");
+ 					else
+ 						strcat(order2, " ASC");
++					}
++					else
++					{
++						DPRINTF(E_INFO, L_TIVO, "Reverse order string too long [%s]\n", item);
++						goto unhandled_order;
++					}
+ 				}
+ 				else
+ 				{
++					if (strlen(order)+5 < 96 && strlen(order2)+5 < 96)
++					{
+ 					strcat(order, " ASC");
+ 					if( itemCount >= 0 )
+ 						strcat(order2, " ASC");
+ 					else
+ 						strcat(order2, " DESC");
++					}
++					else
++					{
++						DPRINTF(E_INFO, L_TIVO, "Reverse order string too long [%s]\n", item);
++						goto unhandled_order;
++					}
+ 				}
++				if (strlen(order)+2 < 96 && strlen(order2)+2 < 96)
++				{
+ 				strcat(order, ", ");
+ 				strcat(order2, ", ");
++				}
++				else
++				{
++					DPRINTF(E_INFO, L_TIVO, "Reverse order string too long [%s]\n", item);
++				}
+ 				unhandled_order:
+ 				if( title_state <= 0 )
+ 					item = strtok_r(NULL, ",", &saveptr);
+ 			}
+ 			if( title_state != -1 )
+ 			{
++				if (strlen(order)+11 < 96 && strlen(order2)+11 < 96)
++				{
+ 				strcat(order, "TITLE ASC, ");
+ 				if( itemCount >= 0 )
+ 					strcat(order2, "TITLE ASC, ");
+ 				else
+ 					strcat(order2, "TITLE DESC, ");
++				}
++				else
++				{
++					DPRINTF(E_INFO, L_TIVO, "order string too long [%s]\n", item);
++					goto unhandled_order2;
++				}
+ 			}
++			if (strlen(order)+11 < 96 && strlen(order2)+11 < 96)
++			{
+ 			strcat(order, "DETAIL_ID ASC");
+ 			if( itemCount >= 0 )
+ 				strcat(order2, "DETAIL_ID ASC");
+ 			else
+ 				strcat(order2, "DETAIL_ID DESC");
++			}
++			else
++			{
++				DPRINTF(E_INFO, L_TIVO, "order string too long [%s]\n", item);
++			}
++			unhandled_order2:
+ 		}
+ 	}
+ 	else
+@@ -528,27 +607,38 @@ SendContainer(struct upnphttp *h, const
+ 		{
+ 			if( i )
+ 			{
++				if (strlen(myfilter)+4 < 256)
+ 				strcat(myfilter, " or ");
++				else goto unhandled_filter;
+ 			}
+ 			if( (strcasecmp(item, "x-container/folder") == 0) ||
+ 			    (strncasecmp(item, "x-tivo-container/", 17) == 0) )
+ 			{
++				if (strlen(myfilter)+23 < 256)
+ 				strcat(myfilter, "CLASS glob 'container*'");
++				else goto unhandled_filter;
+ 			}
+ 			else if( strncasecmp(item, "image", 5) == 0 )
+ 			{
++				if (strlen(myfilter)+19 < 256)
+ 				strcat(myfilter, "MIME = 'image/jpeg'");
++				else goto unhandled_filter;
+ 			}
+ 			else if( strncasecmp(item, "audio", 5) == 0 )
+ 			{
++				if (strlen(myfilter)+19 < 256)
+ 				strcat(myfilter, "MIME = 'audio/mpeg'");
++				else goto unhandled_filter;
+ 			}
+ 			else if( strncasecmp(item, "video", 5) == 0 )
+ 			{
++				if (strlen(myfilter)+67 < 256)
+ 				strcat(myfilter, "MIME in ('video/mpeg', 'video/x-tivo-mpeg', 'video/x-tivo-mpeg-ts')");
++				else goto unhandled_filter;
+ 			}
+ 			else
+ 			{
++				unhandled_filter:
+ 				DPRINTF(E_INFO, L_TIVO, "Unhandled Filter [%s]\n", item);
+ 				if( i )
+ 				{
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/minidlna.git/commitdiff/f30c237c79f7238141917fed1abd3cafb230e80b



More information about the pld-cvs-commit mailing list