If dash is launched without plugins installed, a Selector instance is constructed for the settings UI (brightness plugin selector) with an empty options list. This results in a past-the-end iterator being returned from the max_element algorithm. This iterator should be checked before dereferencing, or the access results in a segmentation fault. This change provides a default length in that case.
An additional improvement would provide a warning message when the plugins cannot be found.
I'm picking up where @matt2005 left off on the Yocto build, and the main CMakeLists.txt has some problems that render it incompatible for cross compilation with Yocto. It seems that the plugins directory is not included properly somehow. More on that soon.
Checklist:
[x] The code change is tested and works locally. (compile only, since this is a small edge case)
Description:
If dash is launched without plugins installed, a Selector instance is constructed for the settings UI (brightness plugin selector) with an empty options list. This results in a past-the-end iterator being returned from the max_element algorithm. This iterator should be checked before dereferencing, or the access results in a segmentation fault. This change provides a default length in that case.
An additional improvement would provide a warning message when the plugins cannot be found.
I'm picking up where @matt2005 left off on the Yocto build, and the main CMakeLists.txt has some problems that render it incompatible for cross compilation with Yocto. It seems that the plugins directory is not included properly somehow. More on that soon.
Checklist: