[sane-devel] saned array memory limit

Henning Meier-Geinitz henning@meier-geinitz.de
Thu, 14 Oct 2004 19:21:15 +0200


Hi everyone,

There was a long-standing bug in saned that allowed to alloc huge
amounts of memory on the server by simply sending big string (or
array) sizes. I've now limited the total size of malloced arrays (and
pointers) by sanei_wire to 1 MB in CVS.

This limit applies e.g. to usernames (in SANE_NET_INIT) and options
(e.g. gamma curves).

Please test if your backend still works over the net.

If you get the following error, you may have found a bug or a really
big option value:
[sanei_wire] sanei_w_array: DECODE: maximum amount of allocated memory exceeded (limit: 1048576, new allocation: 4294967295, total: 1048575 bytes)

Do "make clean" before "make" otherwise the changes caused by the
header file won't be picked up.

Bye,
  Henning