[Foo2zjs-maintainer] Bug#446132: foo2zjs: cannot handle -u 0x100 option
Julian Gilbey
jdg at debian.org
Wed Oct 10 17:02:05 UTC 2007
Package: foo2zjs
Version: 20070718dfsg-2
Tags: patch
When running the command:
foo2zjs-wrapper -u 0x100 file.pdf
I receive the error:
Illegal format '0x100' for -u
This is because in the function parse_xy in foo2zjs.c, the first
integer is read using the command:
*xp = strtoul(str, &p, 0);o
so that 0x1000 is interpreted as hex 1000, rather than the pair of
numbers 0, (decimal) 1000; using -u 00x1000 fixes this.
Furthermore, xp is a (signed) int, whereas strtoul returns an unsigned
long, which might lead to incorrect results.
The simple fix is to replace every such occurrence of strtoul by
strtol and set the base (third parameter) to be 10. The worst that
could then happen is an arithmetic overflow.
Julian
More information about the Foo2zjs-maintainer
mailing list