Fix a crash due to missing zero-bytes check

Resolves: #1767921
epel9
Marek Kasik 5 years ago
parent 74ff854317
commit a860c0328f

@ -0,0 +1,28 @@
From 9658b01431cd7ff6344d7787f855179e73fe81a7 Mon Sep 17 00:00:00 2001
From: Leon Bottou <leon@bottou.org>
Date: Mon, 8 Apr 2019 22:55:38 -0400
Subject: fix bug #298
diff --git a/libdjvu/GBitmap.h b/libdjvu/GBitmap.h
index e8e0c9b..ca89a19 100644
--- a/libdjvu/GBitmap.h
+++ b/libdjvu/GBitmap.h
@@ -566,7 +566,7 @@ GBitmap::operator[](int row)
{
if (!bytes)
uncompress();
- if (row<0 || row>=nrows) {
+ if (row<0 || row>=nrows || !bytes) {
#ifndef NDEBUG
if (zerosize < bytes_per_row + border)
G_THROW( ERR_MSG("GBitmap.zero_small") );
@@ -581,7 +581,7 @@ GBitmap::operator[](int row) const
{
if (!bytes)
((GBitmap*)this)->uncompress();
- if (row<0 || row>=nrows) {
+ if (row<0 || row>=nrows || !bytes) {
#ifndef NDEBUG
if (zerosize < bytes_per_row + border)
G_THROW( ERR_MSG("GBitmap.zero_small") );

@ -3,7 +3,7 @@
Summary: DjVu viewers, encoders, and utilities
Name: djvulibre
Version: 3.5.27
Release: 15%{?dist}
Release: 16%{?dist}
License: GPLv2+
URL: http://djvu.sourceforge.net/
Source0: http://downloads.sourceforge.net/djvu/%{name}-%{version}.tar.gz
@ -12,6 +12,7 @@ Patch0: djvulibre-3.5.22-cdefs.patch
Patch2: djvulibre-3.5.27-buffer-overflow.patch
Patch3: djvulibre-3.5.27-infinite-loop.patch
Patch4: djvulibre-3.5.27-stack-overflow.patch
Patch5: djvulibre-3.5.27-zero-bytes-check.patch
Requires(post): xdg-utils
Requires(preun): xdg-utils
@ -67,6 +68,7 @@ Development files for DjVuLibre.
%patch2 -p1 -b .buffer-overflow
%patch3 -p1 -b .infinite-loop
%patch4 -p1 -b .stack-overflow
%patch5 -p1 -b .zero-bytes-check
%build
@ -174,6 +176,10 @@ fi
%changelog
* Thu Nov 7 2019 Marek Kasik <mkasik@redhat.com> - 3.5.27-16
- Fix a crash due to missing zero-bytes check
- Resolves: #1767921
* Thu Nov 7 2019 Marek Kasik <mkasik@redhat.com> - 3.5.27-15
- Fix a stack overflow
- Resolves: #1767868

Loading…
Cancel
Save