[packages/libquirc] Rel 2. Fix a hang on crafted images.

arekm arekm at pld-linux.org
Thu Nov 26 09:19:41 CET 2026


commit bc8b0c1435b3794e7fd2a6a2fe7a804bed1052c9
Author: Arkadiusz Miśkiewicz <arekm at maven.pl>
Date:   Thu Nov 26 03:01:11 2026 +0100

    Rel 2. Fix a hang on crafted images.
    
    Bound the alignment pattern spiral search in find_alignment_pattern(),
    as in upstream quirc PR 159. Fixes CVE-2026-110596.

 libquirc-CVE-2026-110596.patch | 21 +++++++++++++++++++++
 libquirc.spec                  |  4 +++-
 2 files changed, 24 insertions(+), 1 deletion(-)
---
diff --git a/libquirc.spec b/libquirc.spec
index a926726..d1ee1dd 100644
--- a/libquirc.spec
+++ b/libquirc.spec
@@ -7,13 +7,14 @@ Summary:	Library for extracting and decoding QR codes
 Summary(pl.UTF-8):	Biblioteka do wydobywania i dekodowania kodów QR
 Name:		libquirc
 Version:	1.0.2
-Release:	1
+Release:	2
 License:	ISC
 Group:		Libraries
 #Source0Download: https://github.com/evolation/libquirc/tags
 Source0:	https://github.com/evolation/libquirc/archive/%{version}/%{name}-%{version}.tar.gz
 # Source0-md5:	df67eaa474850cb7a0f7acd404a38417
 Patch0:		%{name}-make.patch
+Patch1:		%{name}-CVE-2026-110596.patch
 URL:		https://github.com/evolation/libquirc
 %if %{with sdl}
 BuildRequires:	SDL-devel
@@ -72,6 +73,7 @@ Narzędzia do kodów QR wykorzystujące bibliotekę quirc.
 %prep
 %setup -q
 %patch -P0 -p1
+%patch -P1 -p1
 
 %build
 %{__make} libquirc.so %{?with_static_libs:libquirc.a} %{?with_sdl:quirc-demo quirc-scanner} \
diff --git a/libquirc-CVE-2026-110596.patch b/libquirc-CVE-2026-110596.patch
new file mode 100644
index 0000000..7a60a18
--- /dev/null
+++ b/libquirc-CVE-2026-110596.patch
@@ -0,0 +1,21 @@
+# CVE-2026-110596: bound the alignment pattern spiral search (hang on crafted image)
+# https://github.com/dlbeer/quirc/pull/159
+--- libquirc-1.0.2/lib/identify.c.orig	2026-01-01 00:00:00.000000000 +0100
++++ libquirc-1.0.2/lib/identify.c	2026-01-01 00:00:00.000000000 +0100
+@@ -490,8 +490,15 @@
+ 	/* Spiral outwards from the estimate point until we find something
+ 	 * roughly the right size. Don't look too far from the estimate
+ 	 * point.
++	 *
++	 * A degenerate perspective transform (near-zero denominator) can make
++	 * size_estimate enormous, spinning this spiral for hundreds of millions
++	 * of iterations on a tiny image (denial of service on a crafted QR). The
++	 * alignment pattern must lie within the image, so also cap the search
++	 * radius at the image size.
+ 	 */
+-	while (step_size * step_size < size_estimate * 100) {
++	const int max_step = (q->w > q->h ? q->w : q->h) + 1;
++	while (step_size * step_size < size_estimate * 100 && step_size <= max_step) {
+ 		static const int dx_map[] = {1, 0, -1, 0};
+ 		static const int dy_map[] = {0, -1, 0, 1};
+ 		int i;
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/libquirc.git/commitdiff/bc8b0c1435b3794e7fd2a6a2fe7a804bed1052c9



More information about the pld-cvs-commit mailing list