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 685419 - gtkprintbackendfile: Infinite loop in _cairo_write()
gtkprintbackendfile: Infinite loop in _cairo_write()
Status: RESOLVED FIXED
Product: gtk+
Classification: Platform
Component: Printing
3.5.x
Other Linux
: Normal normal
: ---
Assigned To: gtk-bugs
gtk-bugs
Depends on:
Blocks:
 
 
Reported: 2012-10-03 17:43 UTC by Carlos Garcia Campos
Modified: 2013-04-14 10:22 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Patch (2.09 KB, patch)
2012-10-03 17:43 UTC, Carlos Garcia Campos
committed Details | Review

Description Carlos Garcia Campos 2012-10-03 17:43:06 UTC
Created attachment 225698 [details] [review]
Patch

It can happen if the io channel has been closed. In that case g_io_channel_write_chars() returns early because of a g_return macro that checks if the io channel is writable. When returning from g_return macros, the bytes written output parameter is not updated and the error is not filled, so the error is not detected and the written variable is used uninitialized. We should check the return value of g_io_channel_write_chars() to break the loop.
Comment 1 Marek Kašík 2013-04-11 12:36:00 UTC
Review of attachment 225698 [details] [review]:

Hi,

thank you for the report and the patch. The patch looks good. I have just 2 comments. Could you insert one blank line above the "return CAIRO_STATUS_WRITE_ERROR;" and place the link to this bug to the message? After that, commit it to gtk-3-8 and master please.

Marek
Comment 2 Carlos Garcia Campos 2013-04-14 10:21:52 UTC
Comment on attachment 225698 [details] [review]
Patch

Pushed to both branches.