After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 653571 - Missing check when seeking in font
Missing check when seeking in font
Status: RESOLVED FIXED
Product: gnome-utils
Classification: Deprecated
Component: font-viewer
unspecified
Other Linux
: Normal normal
: ---
Assigned To: gnome-utils Maintainers
gnome-utils Maintainers
Depends on:
Blocks:
 
 
Reported: 2011-06-28 13:34 UTC by Marek Kašík
Modified: 2011-06-30 08:26 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
the patch with check and correct return value (610 bytes, patch)
2011-06-28 13:34 UTC, Marek Kašík
committed Details | Review

Description Marek Kašík 2011-06-28 13:34:11 UTC
gnome-font-viewer uses its own function vfs_stream_read() for reading/seeking in FT_Stream. Unfortunately it doesn't check offset against stream size when seeking so it can happen that it seeks beyond the stream but doesn't return an error (it uses lseek() at the end).

Another problem is that even if an error arises during seeking the function doesn't return correct value. It should return a value higher than zero (as ft_ansi_stream_io() does).

You can reproduce the problem by opening font from the bottom of the page http://lists.nongnu.org/archive/html/freetype-devel/2011-06/msg00035.html in gnome-font-viewer. But you have to disable freetype-2.4.2-CVE-2010-3311.patch patch in freetype2 if you use Fedora to see the problem.

The attached patch fixes this.

Marek
Comment 1 Marek Kašík 2011-06-28 13:34:49 UTC
Created attachment 190858 [details] [review]
the patch with check and correct return value
Comment 2 Cosimo Cecchi 2011-06-28 14:26:13 UTC
Review of attachment 190858 [details] [review]:

Thanks, looks good.
Comment 3 Marek Kašík 2011-06-29 08:25:19 UTC
I've committed it to the master branch. Can I commit it also to stable branch "gnome-3-0" ?
Comment 4 Cosimo Cecchi 2011-06-30 01:45:38 UTC
Yes, feel free to push it there too.