Skip to content
  • hongjinghao's avatar
    Do not crash when reloading configuration with > 128 dirs · c3b1e4da
    hongjinghao authored and Simon McVittie's avatar Simon McVittie committed
    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