Bug 67324

Summary: cairo_type1_subset.c: write_used_glyphs should check _cairo_winansi_to_glyphname return value
Product: cairo Reporter: Salvador Ortiz <salvador.ortiz>
Component: generalAssignee: Chris Wilson <chris>
Status: RESOLVED FIXED QA Contact: cairo-bugs mailing list <cairo-bugs>
Severity: normal    
Priority: medium    
Version: 1.12.14   
Hardware: Other   
OS: All   
Whiteboard:
i915 platform: i915 features:
Attachments: A simple patch that fixed the issue.

Description Salvador Ortiz 2013-07-25 20:09:53 UTC
Created attachment 83008 [details]
A simple patch that fixed the issue.

After segmentation faults in inkscape and rsvg_convert, the backtrace points to strlen called from write_used_glyphs in cairo.

Please see https://bugzilla.redhat.com/show_bug.cgi?id=957009 for the bug reported to Fedora.

In some cases _cairo_winansi_to_glyphname can return null, so write_used_glyphs should check that.

Attached a naive patch that fixed the problem.

Regards.
Comment 1 Adrian Johnson 2013-07-28 00:13:33 UTC
> In some cases _cairo_winansi_to_glyphname can return null, so
> write_used_glyphs should check that.
> 
> Attached a naive patch that fixed the problem.

After figuring out why _cairo_winansi_to_glyphname was returning NULL it turns out your naive patch is the correct fix. I've pushed out a reformatted and commented version of the patch.

http://cgit.freedesktop.org/cairo/commit/?id=274863be08f6c8df6d411df9db725d34f7fbabea

Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.