Notification service hangs on wrong dbus call

Issue Description

I've been using XFCE for a long time now (around 10 years) and loving the experience. Thank you for your brilliant work.

I was playing with dbus-send for my personal project. I'm in no means an expert on freedesktop specs. I wanted to test sending notifications from my app. I put a wrong number of args in actions argument incorrectly assuming it type (array of "actions", whereas it is array of 2-tuples of string). At first the notification worked but showed only the "second" action. When I sent only one "action", the notification service hanged. I've learned now about the correct type. I don't think that this is the correct behaviour.

Steps to Reproduce Issue

  1. Have xfce4-notifyd runnning normally
dbus-send \
--session \
--print-reply \
--dest=org.freedesktop.Notifications \
/org/freedesktop/Notifications \
org.freedesktop.Notifications.Notify \
string:"firefox" \
uint32:0 \
string: \
string:"abc" \
string:"abcbca" \
array:string:abcbca \#only one arg here 
dict:string:variant: \
int32:0
  1. This and any subsequent calls to .Notify hang.

Expected Behavior

The daemon should not hang on incorrect number of arguments?

Additional Information

I think, the error is here:

https://gitlab.xfce.org/apps/xfce4-notifyd/-/blob/master/xfce4-notifyd/xfce-notify-daemon.c?ref_type=heads#L1397

And the proposed fix:

     while (*cur_action_id != NULL) {
         if (cur_action_id[1] != NULL) {
             cur_action_id += 2;
             ++n_actions;
-        }
+        }else{
+            // do error handling
+        }
     }

Versions

  • OS distribution and version: Arch Linux
  • Overall Xfce version: 4.20
  • xfce4-notifyd version (git hash if not a release): 0.9.7
  • Windowing system (X11/Wayland): X11
  • Compositor and version (if Wayland):
Edited by Pavel Pletenev