Bug#786452: libsane: artec_eplus48u backend crashes saned

2015-05-22 Thread Jörg Frings-Fürst
tags 786452 + pending
thanks


Hello Alexander,

many thanks for your very good documented bug report. I have fixed the
bug at version 1.0.24-12.

The package will be uploaded to unstable this weekend.



Schönes Pfingst-Wochenende


CU
Jörg 


-- 
New:
GPG Fingerprint: 63E0 075F C8D4 3ABB 35AB  30EE 09F8 9F3C 8CA1 D25D
GPG key (long) : 09F89F3C8CA1D25D
GPG Key: 8CA1D25D
CAcert Key S/N : 0E:D4:56

Old pgp Key: BE581B6E (revoked since 2014-12-31).

Jörg Frings-Fürst
D-54526 Niederkail

Threema: SYR8SJXB

IRC: j_...@freenode.net
 j_...@oftc.net

My wish list: 
 - Please send me a picture from the nature at your home.




signature.asc
Description: This is a digitally signed message part


Bug#786452: libsane: artec_eplus48u backend crashes saned

2015-05-21 Thread Alexander Clausen
Package: libsane
Version: 1.0.24-8
Severity: important

Dear Maintainer,

Using the artec_eplus48u backend (via network in my case) crashes saned.
I was able to capture the following backtrace:

#0  __strlen_sse2 () at ../sysdeps/i386/i686/multiarch/strlen-sse2.S:62
#1  0xb60205b9 in load_calibration_data (s=0xb5461008) at
artec_eplus48u.c:3583
#2  0xb602571f in sane_artec_eplus48u_open (devicename=0xb5461008 ,
handle=0xbfc5bbb4) at artec_eplus48u.c:3885
#3  0xb775f4f2 in sane_dll_open (full_name=optimized out,
meta_handle=0xbfc5bc38) at dll.c:1200
#4  0xb775c82c in sane_open (name=0xb8a66530
artec_eplus48u:libusb:003:002, h=0xbfc5bc38) at dll-s.c:23
#5  0xb77a7b8a in process_request (w=optimized out) at saned.c:1916
#6  0xb77a8125 in handle_connection (fd=2) at saned.c:2283
#7  0xb77a4a11 in handle_client (fd=5) at saned.c:2309
#8  run_standalone (argv=optimized out, argc=optimized out) at
saned.c:3152
#9  main (argc=3, argv=0xbfc5bec4) at saned.c:3345

The code in question (artec_eplus48.c around line 3583):

[... load_calibration_data() ...]
s-calibrated = SANE_FALSE;
path[0] = 0;
if (strlen (getenv (HOME))  (PATH_MAX - 1))
  strcat (path, getenv (HOME));
else
  return SANE_STATUS_INVAL
[...]

Because saned, as started by systemd, does not have the HOME varible in its 
environment,
getenv(HOME) returns 0 and strlen crashes. This can be verified by
setting HOME in the init script: saned no longer crashes and scanning
works fine.

Hope this helps,

Alex


-- System Information:
Debian Release: 8.0
  APT prefers stable
  APT policy: (990, 'stable'), (500, 'stable-updates'), (500, 'testing')
Architecture: i386 (i686)

Kernel: Linux 3.16.0-4-686-pae (SMP w/4 CPU cores)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
Init: systemd (via /run/systemd/system)

Versions of packages libsane depends on:
ii  acl2.2.52-2
ii  adduser3.113+nmu3
ii  libavahi-client3   0.6.31-5
ii  libavahi-common3   0.6.31-5
ii  libc6  2.19-18
ii  libexif12  0.6.21-2
ii  libgphoto2-6   2.5.4-1.1+b2
ii  libgphoto2-port10  2.5.4-1.1+b2
ii  libieee1284-3  0.2.11-12
ii  libjpeg62-turbo1:1.3.1-12
ii  libsane-common 1.0.24-8
ii  libtiff5   4.0.3-12.3
ii  libusb-1.0-0   2:1.0.19-1
ii  libv4l-0   1.6.0-2
ii  makedev2.3.1-93
ii  multiarch-support  2.19-18
ii  udev   215-17

Versions of packages libsane recommends:
ii  libsane-extras  1.0.22.3
ii  sane-utils  1.0.24-8

Versions of packages libsane suggests:
ii  avahi-daemon  0.6.31-5
pn  hplip none
pn  hpoj  none

-- Configuration Files:
/etc/sane.d/abaton.conf 51591e7ab98851effab49089323cb160 [Errno 2] No such file 
or directory: u'/etc/sane.d/abaton.conf 51591e7ab98851effab49089323cb160'
/etc/sane.d/agfafocus.conf f763f1f31d26507986aad58ca02f79f9 [Errno 2] No such 
file or directory: u'/etc/sane.d/agfafocus.conf 
f763f1f31d26507986aad58ca02f79f9'
/etc/sane.d/apple.conf 602eda3ecedd81ef751d9241becb9142 [Errno 2] No such file 
or directory: u'/etc/sane.d/apple.conf 602eda3ecedd81ef751d9241becb9142'
/etc/sane.d/artec.conf 1b87eeb6069e6f5ac7b5f0cc4bf48083 [Errno 2] No such file 
or directory: u'/etc/sane.d/artec.conf 1b87eeb6069e6f5ac7b5f0cc4bf48083'
/etc/sane.d/artec_eplus48u.conf 3672fe16e6b14a124ad74acd47941be9 [Errno 2] No 
such file or directory: u'/etc/sane.d/artec_eplus48u.conf 
3672fe16e6b14a124ad74acd47941be9'
/etc/sane.d/avision.conf 51e9f41665cca34d58ceb8bcf2ed072f [Errno 2] No such 
file or directory: u'/etc/sane.d/avision.conf 51e9f41665cca34d58ceb8bcf2ed072f'
/etc/sane.d/bh.conf ed8e137983ae58a7bf038180b29737bd [Errno 2] No such file or 
directory: u'/etc/sane.d/bh.conf ed8e137983ae58a7bf038180b29737bd'
/etc/sane.d/canon.conf 099d16dab225eaa121f1ba2f3af9f60a [Errno 2] No such file 
or directory: u'/etc/sane.d/canon.conf 099d16dab225eaa121f1ba2f3af9f60a'
/etc/sane.d/canon630u.conf 5fae93df3328f1915e3d26f77a8c3b9d [Errno 2] No such 
file or directory: u'/etc/sane.d/canon630u.conf 
5fae93df3328f1915e3d26f77a8c3b9d'
/etc/sane.d/canon_dr.conf c5b4e2008dba36c4a9df50f7e89fb65a [Errno 2] No such 
file or directory: u'/etc/sane.d/canon_dr.conf c5b4e2008dba36c4a9df50f7e89fb65a'
/etc/sane.d/canon_pp.conf 2ecfac7c883bc980aba880f424abb8ad [Errno 2] No such 
file or directory: u'/etc/sane.d/canon_pp.conf 2ecfac7c883bc980aba880f424abb8ad'
/etc/sane.d/cardscan.conf c53b0f155e8abb0e35da6e4bd9898e41 [Errno 2] No such 
file or directory: u'/etc/sane.d/cardscan.conf c53b0f155e8abb0e35da6e4bd9898e41'
/etc/sane.d/coolscan.conf b5a49230bc9b80a4358d966255d4697a [Errno 2] No such 
file or directory: u'/etc/sane.d/coolscan.conf b5a49230bc9b80a4358d966255d4697a'
/etc/sane.d/coolscan2.conf e9039d4f201acacca70e8964ec22ee70 [Errno 2] No such 
file or directory: u'/etc/sane.d/coolscan2.conf 
e9039d4f201acacca70e8964ec22ee70'
/etc/sane.d/coolscan3.conf dc124184659f6acfcb2f77d4759adc8c [Errno 2] No such 
file or directory: