Closed zdohnal closed 9 months ago
The key for reproducing the issue is that it must be the first run of legacy-printer-app after its installation and start. I was not able to reproduce in other runs.
Hard to diagnose this without a backtrace...
Full backtrace of the crash - the program crashes in libcups, because it tries to access invalid memory, which was freed in pappl, however it is accessed later during generating driver attributes. It is the thread 1, in ippFindNextAttribute() function.
[master 47cfc65] Fix printer-device-id (Issue #322)
[v1.4.x 8820820] Bump version/copyright.
Thank you for the fix, Mike! It works in my testing env.
If legacy-printer-app is run for the first time and generic PS driver was chosen when installing the printer, the application crashes during adding the printer.
It is because the printer structure does not have device_id set, and the library tries to get data from already freed
printer->driver_attrs
. Additionally, if the device id exists in the printer, it rewrites incorrect structure (we should set device id attr inattrs
, which we return).The fix adds possibility to extract device id from
printer->attrs
and if device id is missing inprinter->attrs
anddocument-format-supported
as well, trydocument-format-default
and if this attribute is missing, return NULL.