cee097664e
- avoid segfault in DJGenericVIP::DJGenericVIP() (boo#1094141) * added hpijs-avoid-segfault-in-DJGenericVIP-DJGenericVIP.patch OBS-URL: https://build.opensuse.org/request/show/613815 OBS-URL: https://build.opensuse.org/package/show/Printing/hplip?expand=0&rev=153
74 lines
2.2 KiB
Diff
74 lines
2.2 KiB
Diff
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
|
|
|