openDsh / dash

Join us on Slack! https://join.slack.com/t/opendsh/shared_invite/zt-la398uly-a6eMH5ttEQhbtE6asVKx4Q
GNU General Public License v3.0
238 stars 69 forks source link

Fix iterator deref without PTE check #71

Closed KK1423 closed 2 years ago

KK1423 commented 3 years ago

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:

rsjudka commented 3 years ago

hey thanks for picking up the yocto build work! I actually have this fix in the current feature I'm working on, just need to finish it up haha

rsjudka commented 2 years ago

fixed by #106