#1145973 wmctrl: crashes when WM_CLIENT_MACHINE property is absent

#1145973#5
Date:
2026-08-28 12:33:17 UTC
From:
To:
The crash occurs in display_window(), which calls strlen() on the value returned by get_property(). When WM_CLIENT_MACHINE is absent, get_property() returns NULL, resulting in strlen(NULL).

The issue can be reproduced as follows:

$ wmctrl -l
0x00800008 -1 N/A tint2
0x0100000e  0 x86 linux@x86: ~
The first window does not have WM_CLIENT_MACHINE and crashes when information is requested:
$ wmctrl -i -p 0x00800008 -L
Segmentation fault

Whereas a window with WM_CLIENT_MACHINE works correctly:
$ wmctrl -i -r 0x0100000e -L
0x0100000e  0 x86 linux@x86: ~

Please consider applying the attached patch, which checks for NULL before calling strlen().