From dde5c8fdc42048054683ca985899ef67466ac27a Mon Sep 17 00:00:00 2001 From: Simon McVittie Date: Mon, 21 Jun 2021 12:02:27 +0100 Subject: [PATCH] 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 --- tools/dbus-send.c | 7 +++++++ 1 file changed, 7 insertions(+) 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);