[sane-devel] rebased patches for epjitsu

Peter Marschall peter at adpm.de
Sat Jun 21 14:57:54 UTC 2014


Hi,

with epjitsu v25 included into upstream, I updated my patch-series against it.
Please find it at my github repo

	https://github.com/marschap/sane-backends/tree/epjitsu-patches

Here's the list of the patches (more descriptions are in the commit messages)

* epjitsu: return \0 even when length is zero in sane_read()
  '\0'-terminate the buffer returned even when size is 0.
  This is a security measure to help some sloppy clients.

* epjitsu: simplify calls to do_cmd()
  - initialize cmd args at declaration
  - don't change & re-use cmd, instead use an alternative variable
  - use sizeof() to determine the size of cmd & other args
  This makes the code shorter, and - in my opinion - easier to read/understand

* epjitsu: make assignments clearer by using the ?: operator
  -  use x = (...) ? y : z instead of lengthy if (...) x = y else x = z
  This makes the code shorter, and - in my opinion - easier to read/understand

* epjitsu: introduce & use MAX() & MIN()
  - express the logical concept clearer my using MIN() and MAX()
  This makes the code shorter, and - in my opinion - easier to read/understand

* epjitsu: use ternary ?: operator in some functions
  This makes the code shorter, and - in my opinion - easier to read/understand

* epjitsu: refactor sane_get_devices()
  - flexibilize config file format slightly
  - use sanei functions to get strings
  - consistent indenting, ...
  This makes the code - in my opinion - easier to read/understand

* epjitsu.c: fix typo
   - just s small typo fix

* epjitsu: remove unused value OPT_Y_RES from 'scanner_Option' enum
  - remove unused enum value
  Avoid confusion by removing unusecd parts

* epjitsu: remove unused properties y_res_* of struct scanner
  - remove unused properties
  Avoid confusion by removing unusecd parts

* epjitsu: bug fix - avoid overrunning x_res_list in struct scanner
  - extend size of x_rese_lsit to avoid variable overrun
  Security fix

* epjitsu: refactor attach_one() - split out init_options()
  Re-factoring to have shorter functions, which are easier to read/understand

* epjitsu: refactor attach_one() - split out init_model()
  Re-factoring to have shorter functions, which are easier to read/understand

* epjitsu: instrument finecal_send_cal() & finecal_get_line() with DBG() calls
  Consistency with other functions / improved debugging

* epjitsu: fix start & finish DBG() calls in coarsecal*()
  Consistency with other functions / improved debugging

* epjitsu: refactor attach_one() - split out init_user()
  Shorter functions / make user defaults explicit

* epjitsu: sane_start() - get hardware status at least once
   With some clients I seem to need this for S1300i

* epjitsu: enforce range.max >= range.min in option descriptors
   Security fix - I was bitten by this.

It would be great if they could be included in the upstream of sane-backends.

If you do not like all of them, leave those away that you do not like,
but at least take the security fixes.

Thanks for sane
Peter

-- 
Peter Marschall
peter at adpm.de




More information about the sane-devel mailing list