Page MenuHomePhabricator

imlib2 does not load acii PNM files correctly
Closed, ResolvedPublic


This is Debian bug reported by Aravind Sundaresan.

The affected code seems to be still present. He attached a diff to the bug report but unfortunately no test case.


I find that the loader_pnm.c file in the source package has bugs which
manifest themselves while reading ascii PNM files. To be specific the
data is read using a char buffer and fgets(). When the buffer ends in
the middle of a number which is more than 1 character long, the parser
splits that number into two.

I have corrected two instances f this mistake in loader_pnm.c.mine

I have attached the output of
diff imlib2-

This is an important bug as applications like feh use this to load
images and PNM format images are used extensively in research.


apoleon created this task.Mar 7 2018, 6:50 AM
apoleon triaged this task as Normal priority.
kwo closed this task as Resolved.Mar 9 2018, 1:11 PM

Should now be fixed in git.
The committed fix is somewhat more radical than the suggested one.

kwo added a project: Restricted Project.Mar 10 2018, 12:22 PM