lxqt / lxqt-config

Tools to configure LXQt and the underlying operating system
https://lxqt.github.io
GNU Lesser General Public License v2.1
79 stars 60 forks source link

Fix potential segfault when loading keyboard layout settings #909

Closed krukai closed 1 year ago

krukai commented 1 year ago

Previously, lxqt-config-input would crash when setxkbmap reported at least one but fewer variants than layouts. Adjust the existing size check to prevent that from happening.

You can reproduce the current behavior by setting some layouts like so:

setxkbmap de,us nodeadkeys

Starting lxqt-config-input will now result in a crash. If however you set the layouts like this, it will start just fine (note the comma):

setxkbmap de,us nodeadkeys,

In both cases, you can verify that setxkbmap will report the variants as entered:

setxkbmap -query -verbose 5

While I am not sure how I personally ended up with this configuration, I assume I am not the last person to potentially run into this issue.

palinek commented 1 year ago

@krukai good catch, thanks for deep analysis and fix.