diff options
author | Simon McVittie <smcv@collabora.com> | 2021-06-21 12:02:27 +0100 |
---|---|---|
committer | Simon McVittie <smcv@collabora.com> | 2021-06-21 12:02:27 +0100 |
commit | dde5c8fdc42048054683ca985899ef67466ac27a (patch) | |
tree | b5bd94393be75b153f77d23b9cc7b86f012fa2b8 /tools/dbus-send.c | |
parent | ef55a3db0d8f17848f8a579092fb05900cc076f5 (diff) | |
download | dbus-dde5c8fdc42048054683ca985899ef67466ac27a.tar.gz |
dbus-send: Print an error message if object path is syntactically invalid
$ dbus-send // nope
Object path was not valid: '//'
Related to dbus#338.
Signed-off-by: Simon McVittie <smcv@collabora.com>
Diffstat (limited to 'tools/dbus-send.c')
-rw-r--r-- | tools/dbus-send.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/tools/dbus-send.c b/tools/dbus-send.c index 343fd75a..b6b2d675 100644 --- a/tools/dbus-send.c +++ b/tools/dbus-send.c @@ -417,6 +417,13 @@ main (int argc, char *argv[]) usage (1); } + if (!dbus_validate_path (path, &error)) + { + fprintf (stderr, "%s\n", error.message); + dbus_error_free (&error); + exit (1); + } + if (address != NULL) { connection = dbus_connection_open (address, &error); |