Bug 99759 - dbus-send: Handle OOM failures by aborting
Summary: dbus-send: Handle OOM failures by aborting
Status: RESOLVED FIXED
Alias: None
Product: dbus
Classification: Unclassified
Component: core (show other bugs)
Version: unspecified
Hardware: All All
: medium normal
Assignee: D-Bus Maintainers
QA Contact: D-Bus Maintainers
URL:
Whiteboard: review+
Keywords: patch
Depends on:
Blocks:
 
Reported: 2017-02-10 11:24 UTC by Philip Withnall
Modified: 2017-02-13 16:42 UTC (History)
0 users

See Also:
i915 platform:
i915 features:


Attachments
dbus-send: Handle OOM failures by aborting (7.73 KB, patch)
2017-02-10 11:24 UTC, Philip Withnall
Details | Splinter Review

Description Philip Withnall 2017-02-10 11:24:46 UTC
Fix a Coverity bug *and* a FIXME comment in one fell swoop by pointlessly handling the almost-impossible case of OOM happening in dbus-send. Sigh.
Comment 1 Philip Withnall 2017-02-10 11:24:48 UTC
Created attachment 129476 [details] [review]
dbus-send: Handle OOM failures by aborting

This is a fairly pointless feature to add, since the current behaviour
was to abort due to a NULL pointer dereference shortly after the OOM
failure. At least now people will get a helpful error message when they
try to use dbus-send on a machine with incurable memory pressure.

Coverity ID: 54710

Signed-off-by: Philip Withnall <withnall@endlessm.com>
Comment 2 Simon McVittie 2017-02-10 12:01:50 UTC
Comment on attachment 129476 [details] [review]
dbus-send: Handle OOM failures by aborting

Review of attachment 129476 [details] [review]:
-----------------------------------------------------------------

::: tools/dbus-send.c
@@ +155,5 @@
>        fprintf (stderr, "%s: Unsupported data type %c\n", appname, (char) type);
>        exit (1);
>      }
> +
> +  handle_oom (ret);

You could use

if (!ret)
  tool_oom ("building arguments");

by adding tool-common.[ch]. But no big deal either way really.
Comment 3 Simon McVittie 2017-02-13 16:42:12 UTC
Fixed in git for 1.11.10, thanks


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.