-
When `dbus-daemon` sets more than 128 directories for `XDG_DATA_DIRS`, none of the elements in `new_dirs` will be `NULL`, which resulted in these loops reading out-of-bounds (undefined behaviour). In practice this led to a crash. To avoid this, make sure to stop iteration at the end of the array. [smcv: Expanded commit message] Resolves: #481
c3b1e4da