hpijs segfault in DJGenericVIP::DJGenericVIP ()
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
HPLIP |
In Progress
|
Undecided
|
Unassigned |
Bug Description
We see a segfault in DJGenericVIP:
DJGenericVIP:
: DJ9xxVIP (pSS, proto)
{
if (!proto && IOMode.bDevID)
{
if (constructor_error != NO_ERROR)
{
ePen = BOTH_PENS;
}
}
else
ePen = BOTH_PENS;
[...]
pMode[
[...]
for (int i = 0; i < (int) ModeCount; i++)
{
Crash here, because pMode[0] and pMode[1] are NULL:
(gdb) print pMode
$20 = {0x0, 0x0, 0x55a4dd774ff0, 0x55a4dd7360e0, 0x55a4dd778220, 0x55a4dd7744a0, 0x55a4dd7745a0, 0x55a4dd776170, 0x55a4dd776270,
0x55a4dd776370, 0x55a4dd7739f0, 0x55a4dd773af0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0}
(gdb) print ModeCount
$21 = 12
ModeCount == 12 means that, before this code was run, ModeCount was 2. That's
the value to which ModeCount is initialized in Printer::Printer(). But
DJ9xxVIP:
DJ9xx-specific modes. That hasn't happened. According to my analysis, this can
occur if VerifyPenInfo() returns an error. DJGenericVIP:
doesn't treat this as fatal error condition (see above). But it's treated as
an error in the superclass constructor DJ9xxVIP:
initialize ModeCount and the pMode list if this happens:
DJ9xxVIP::DJ9xxVIP
(
SystemServices* pSS,
BOOL proto
) :
Printer(pSS, NUM_DJ6XX_FONTS, proto),
PCL3accepts
{
m_bVIPPrinter = TRUE;
if (!proto && IOMode.bDevID)
{
CERRCHECK;
}
else ePen = BOTH_PENS; // matches default mode
See https:/
This has been ovserved with an openSUSE build of hplip 3.17.9, but given that the respective source files are unchanged between 3.17.9 and 3.18.5, it's almost certain that the problem is not specific to the SUSE build.
Changed in hplip: | |
status: | New → In Progress |
I came up with this simplistic patch. Still needs verification.