#1088575 sane: scanadf -L segfaults

Package:
sane
Source:
sane
Description:
scanner graphical frontends
Submitter:
Manny
Date:
2024-11-28 12:51:02 UTC
Severity:
normal
Tags:
#1088575#5
Date:
2024-11-28 12:46:44 UTC
From:
To:
When trying to list the devices (-L or --list-devices), there is some
useful output followed by a segfault:

===8<----------------------------------------
$ scanadf -L
device `escl:http://192.168.178.99:8080' is a HP Officejet Pro 8610 [6955C2] platen,adf scanner
device `airscan:e0:HP Officejet Pro 8610 [6955C2]' is a eSCL HP Officejet Pro 8610 [6955C2] ip=192.168.178.99
device `hpaio:/net/hp_officejet_pro_8610?ip=192.168.178.99&queue=false' is a Hewlett-Packard hp_officejet_pro_8610 all-in-one
Segmentation fault
===8<----------------------------------------

This segfault is inherited in other operations likely because those
other ops internally list the devices. E.g.:

===8<----------------------------------------
$ scanadf -o mydoc.pbm
scanadf: rounded value of br-x from 215.9 to 215.9
scanadf: rounded value of br-y from 297.011 to 297.011
Scanned 0 pages
Segmentation fault
===8<----------------------------------------

If a device is explicitly supplied on the CLI, the segmentation fault
is avoided. E.g.:

===8<----------------------------------------
$ scanadf -o mydoc.pbm -d 'hpaio:/net/hp_officejet_pro_8610?ip=192.168.178.99&queue=false'
Scanned document mydoc.pbm
scanadf: sane_start: Invalid argument
Invalid argument
Scanned 1 pages
===8<----------------------------------------

Despite the above “Invalid argument” errors, the scan works but it
scans the platter instead of using the ADF (which is an entirely
different problem for another bug report). This is just to show the
segfault can be avoided. But of course it should be fixed nonetheless.