When a new_id argument has no fixed interface (e.g. wl_registry.bind),
argsToShort() correctly expands it to three wire-level arguments in the
signature ("sun": string, uint, new_id). However, the types table
generator only emitted one nullptr entry per <arg> element, producing a
2-entry array for a 4-character signature like "usun".
libwayland's wl_closure_print (activated by WAYLAND_DEBUG=client)
iterates over the signature and dereferences types[i] for each
character. With the undersized table this caused an out-of-bounds read.
Without LTO, adjacent zero-filled .rodata happened to mask the bug. With
LTO (e.g. Arch Linux's -flto=auto in makepkg.conf), the compiler packs
static tables tighter, so the OOB read hits live data and causes a
segfault, crashing any hyprwayland-scanner consumer (like hyprlock)
immediately on startup when WAYLAND_DEBUG is set.
Fix: emit 3 nullptr entries in the types table for untyped new_id args,
matching the 3 wire-level slots (string, uint, new_id) that
argsToShort() already generates in the signature.
Fixes: https://github.com/hyprwm/hyprlock/issues/980
* core: member initialize and rm redundant cast
Both pResource can be member initialized and cast is redundant since 4a53f1a
* use designated initializers
to safely use wl_container_of with a class the class has to be no
virtual functions, no inheritance, and uniform access control (e.g all
public)
work around this by putting this into a destroywrapper struct.