Package: sane
Version: 1.0.14
Severity: normal
Dear Maintainer,
It seems that there is a potential integer overflow in src/preview.c
In line 1020 - 1022,
if (fscanf (in, "P6\n# surface: %g %g %g %g %u %u\n%d %d\n255%*[\n]",
psurface + 0, psurface + 1, psurface + 2, psurface + 3,
&psurface_type, &psurface_unit, &width, &height) != 8)
width and height is read from external source.
In line 1037,
p->image_data = malloc (3 * width * height);
width and height is multiplied.
If width and height is large enough, this multiplication may cause integer
overflow and allocate unwanted value.
-- System Information:
Debian Release: 11.0
APT prefers oldstable-updates
APT policy: (500, 'oldstable-updates'), (500, 'oldstable')
Architecture: amd64 (x86_64)
Kernel: Linux 4.4.0-19041-Microsoft
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8),
LANGUAGE=en_US.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
Init: unable to detect