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 793331 - gsubprocess: Fix a critical calling communicate() with no pipes
gsubprocess: Fix a critical calling communicate() with no pipes
Status: RESOLVED FIXED
Product: glib
Classification: Platform
Component: gsubprocess
unspecified
Other All
: Normal normal
: ---
Assigned To: gtkdev
gtkdev
Depends on:
Blocks:
 
 
Reported: 2018-02-09 12:29 UTC by Philip Withnall
Modified: 2018-02-13 16:29 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
gsubprocess: Fix a critical calling communicate() with no pipes (16.52 KB, patch)
2018-02-09 12:29 UTC, Philip Withnall
committed Details | Review

Description Philip Withnall 2018-02-09 12:29:26 UTC
Patch attached. Mostly changes to the unit tests.
Comment 1 Philip Withnall 2018-02-09 12:29:30 UTC
Created attachment 368182 [details] [review]
gsubprocess: Fix a critical calling communicate() with no pipes

If calling g_subprocess_communicate() on a GSubprocess with no
stdout/stderr pipe, a critical warning would be emitted from
g_memory_output_stream_steal_as_bytes(), as it would be called on a NULL
output stream.

Fix that, improve the relevant GIR annotations, and expand the unit
tests to cover it (and various other combinations of flags).

Signed-off-by: Philip Withnall <withnall@endlessm.com>
Comment 2 Matthias Clasen 2018-02-13 16:05:07 UTC
Review of attachment 368182 [details] [review]:

sure
Comment 3 Philip Withnall 2018-02-13 16:28:30 UTC
Thanks. I will backport to glib-2-54 too.

Attachment 368182 [details] pushed as 66ab836 - gsubprocess: Fix a critical calling communicate() with no pipes
Comment 4 Philip Withnall 2018-02-13 16:29:41 UTC
Pushed to glib-2-54 as b4811aa15b27f368ff7359f77a5cd9dc33f82c35.