[sane-devel] [dev] net backend and SANE_ACTION_SET_AUTO

Jochen Eisinger jochen.eisinger@gmx.de
Wed, 05 Sep 2001 19:50:00 +0200


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hi!

Thanks for the hint. I've checked it and you seem to be right. So I
corrected this one in the CVS.

Btw. SANE compiles with gcc-3.02.

regards
- -- jochen

mh wrote:
| Hi all,
| there seems to be a small problem with the net backend and calls to
| sane_control_option(...) with the parameter SANE_ACTION_SET_AUTO
| (SANE version 1.0.5).
|
| According to the SANE standard, "the value of parameter v is completely
| ignored in this case and may be NULL."
| However, the net backend doesn't check for this case, which results in a
| crash in the lines (around line 831, net.c)
|
|  if (value_size > 0)
|  {
|     if ((SANE_Word) value_size == reply.value_size)
|       memcpy (value, reply.value, reply.value_size);
|
| (because value == NULL, but value_size > 0)
|
| The line
|
| if(action == SANE_ACTION_SET_AUTO) value_size = 0;
|
| before (~ line 799, net.c)
|
| req.handle = s->handle;
| req.option = option;
| req.action = action;
| req.value_type = s->opt.desc[option]->type;
| ...
|
| seems to fix the problem.
| Can someone please take a look at this?
|
| Thanks + bb
| Michael
| _______________________________________________
| Sane-devel mailing list
| Sane-devel@www.mostang.com
| http://www.mostang.com/mailman/listinfo/sane-devel
|


- --
~  [This is a signature virus, please copy me into your signature file!]

~  GnuGP public key for jochen.eisinger@gmx.de:
~      http://home.nexgo.de/jochen.eisinger/pubkey.asc
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.6 (GNU/Linux)
Comment: For info see http://www.gnupg.org

iD8DBQE7lmXE8OF76YrreuMRAqOZAKCAJSIkM/WRiyYu5Aur7W/qUd8uWwCfd5PJ
nxDgtl4NC0n7sqrbKBH9ek0=
=m2za
-----END PGP SIGNATURE-----