Accepting request 614561 from Printing

- avoid segfault in DJGenericVIP::DJGenericVIP() (boo#1094141)
  * added hpijs-avoid-segfault-in-DJGenericVIP-DJGenericVIP.patch (forwarded request 613815 from mwilck)

OBS-URL: https://build.opensuse.org/request/show/614561
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/hplip?expand=0&rev=116
This commit is contained in:
Yuchen Lin 2018-06-15 12:31:38 +00:00 committed by Git OBS Bridge
commit 6c7c6ca2fc
3 changed files with 82 additions and 1 deletions

View File

@ -0,0 +1,73 @@
From 894ea64f4742a5c2a5f17f4e950f4ae3599d802e Mon Sep 17 00:00:00 2001
From: Martin Wilck <mwilck@suse.com>
Date: Fri, 1 Jun 2018 17:09:31 +0200
Subject: [PATCH] hpijs: avoid segfault in DJGenericVIP::DJGenericVIP()
DJGenericVIP::DJGenericVIP() doesn't treat an error from VerifyPenInfo() as
fatal, but the superclass constructor DJ9xxVIP::DJ9xxVIP() does. This
may lead to a sefgault in DJGenericVIP::DJGenericVIP() because ModeCount and
pMode aren't initialized by the superclass constructor.
Signed-off-by: Martin Wilck <mwilck@suse.com>
---
prnt/hpijs/dj9xxvip.cpp | 8 ++++++--
prnt/hpijs/dj9xxvip.h | 3 ++-
prnt/hpijs/djgenericvip.cpp | 2 +-
3 files changed, 9 insertions(+), 4 deletions(-)
diff --git a/prnt/hpijs/dj9xxvip.cpp b/prnt/hpijs/dj9xxvip.cpp
index 519036c..0a5c959 100644
--- a/prnt/hpijs/dj9xxvip.cpp
+++ b/prnt/hpijs/dj9xxvip.cpp
@@ -55,7 +55,8 @@ extern MediaType MediaTypeToPcl (MEDIATYPE eMediaType);
DJ9xxVIP::DJ9xxVIP
(
SystemServices* pSS,
- BOOL proto
+ BOOL proto,
+ BOOL ignore_pen_error
) :
Printer(pSS, NUM_DJ6XX_FONTS, proto),
PCL3acceptsDriverware(TRUE)
@@ -67,7 +68,10 @@ DJ9xxVIP::DJ9xxVIP
{
bCheckForCancelButton = TRUE;
constructor_error = VerifyPenInfo();
- CERRCHECK;
+ if (!ignore_pen_error) {
+ CERRCHECK;
+ } else
+ ePen = BOTH_PENS;
}
else ePen = BOTH_PENS; // matches default mode
diff --git a/prnt/hpijs/dj9xxvip.h b/prnt/hpijs/dj9xxvip.h
index 85eb3ac..8d42265 100644
--- a/prnt/hpijs/dj9xxvip.h
+++ b/prnt/hpijs/dj9xxvip.h
@@ -42,7 +42,8 @@ APDK_BEGIN_NAMESPACE
class DJ9xxVIP : public Printer
{
public:
- DJ9xxVIP(SystemServices* pSS, BOOL proto=FALSE);
+ DJ9xxVIP(SystemServices* pSS, BOOL proto=FALSE,
+ BOOL ignore_pen_error=TRUE);
Header* SelectHeader(PrintContext* pc);
DRIVER_ERROR VerifyPenInfo();
diff --git a/prnt/hpijs/djgenericvip.cpp b/prnt/hpijs/djgenericvip.cpp
index b7e79dc..7228fcf 100644
--- a/prnt/hpijs/djgenericvip.cpp
+++ b/prnt/hpijs/djgenericvip.cpp
@@ -47,7 +47,7 @@ extern uint32_t ulMapDJ600_CCM_K[ 9 * 9 * 9 ];
*/
DJGenericVIP::DJGenericVIP (SystemServices* pSS, BOOL proto)
- : DJ9xxVIP (pSS, proto)
+ : DJ9xxVIP (pSS, proto, true)
{
if (!proto && IOMode.bDevID)
--
2.17.0

View File

@ -1,3 +1,9 @@
-------------------------------------------------------------------
Fri Jun 1 15:18:19 UTC 2018 - mwilck@suse.com
- avoid segfault in DJGenericVIP::DJGenericVIP() (boo#1094141)
* added hpijs-avoid-segfault-in-DJGenericVIP-DJGenericVIP.patch
-------------------------------------------------------------------
Thu Mar 22 08:44:17 UTC 2018 - mwilck@suse.com

View File

@ -57,7 +57,7 @@ Name: hplip
Version: 3.17.9
Release: 0
Summary: HP's Printing, Scanning, and Faxing Software
License: BSD-3-Clause and GPL-2.0+ and MIT
License: BSD-3-Clause AND GPL-2.0-or-later AND MIT
Group: Hardware/Printing
Url: http://hplipopensource.com
# Source0...Source9 is for sources from HP:
@ -89,6 +89,7 @@ Patch107: hplip-udev-rules-in-usr.patch
Patch108: add_missing_includes_and_define_GNU_SOURCE.patch
# PATCH-FIX-SUSE: GNOME no longer provides a system tray, so don't warn the user that we can't find it
Patch109: no-systray-failure-message.patch
Patch110: hpijs-avoid-segfault-in-DJGenericVIP-DJGenericVIP.patch
# Patch200 fixes device communication and detection via MDNS in some network setups:
Patch200: hplip-mdns.patch
# Patch201 makes MDNS lookups more robust by retrying queries:
@ -396,6 +397,7 @@ This sub-package is only required by developers.
# and missing '#define _GNU_SOURCE' see https://bugs.launchpad.net/hplip/+bug/1456590
%patch108 -p1 -b .add_missing_includes_and_define_GNU_SOURCE.orig
%patch109 -p1 -b .systemtray.py.orig
%patch110 -p1 -b .boo1094141
%patch200 -p1 -b .mdns
%patch201 -p1 -b .mdns-retry
%patch300 -p1 -b .pcardext-python3