dunst icon indicating copy to clipboard operation
dunst copied to clipboard

NULL pointers passed to *printf

Open Strahinja opened this issue 1 year ago • 3 comments
trafficstars

Issue description

Under OpenBSD, a bunch of lines like

  8 Mar  4 15:45:23 host dunst: vfprintf %s NULL in "[%16s:%04d] summary %s"
  7 Mar  4 15:45:23 host dunst: vfprintf %s NULL in "[%16s:%04d] appname %s"
  6 Mar  4 15:45:23 host dunst: vfprintf %s NULL in "[%16s:%04d] script %s"
  5 Mar  4 15:45:23 host dunst: vfprintf %s NULL in "[%16s:%04d] frame %s"

are added to /var/log/messages. These appear whenever some program passes NULL to the *printf family of functions in OpenBSD. It seems that those come from settings.c, where the struct members are passed to LOG_D without checking if they are NULL.

Installation info

  • Version: Dunst - A customizable and lightweight notification-daemon 1.9.2 (2023-04-20)
  • Install type: package
  • Window manager / Desktop environment: dwm
  • Distro: OpenBSD-release 7.4
Minimal dunstrc
# Dunstrc here

Strahinja avatar Mar 04 '24 21:03 Strahinja

We rely heavily on printing null strings with the assumption that they will be printed as "(null)". Is there no way to turn off those logs?

bynect avatar Mar 04 '24 22:03 bynect

The messages are written by syslogd(8), which can only filter them according to log facility and level. Still, I find it shocking that passing NULLs seems to be a practice rather than an oversight.

Strahinja avatar Mar 04 '24 22:03 Strahinja

It is more of an historical artifact. Anyway I checked and it seems ub, so we may want to change that in the near future

bynect avatar Mar 04 '24 22:03 bynect

@Strahinja if you find that there are some other nulls I forgot to handle feel free to reopen this 👍🏻

bynect avatar Apr 07 '24 20:04 bynect