1
0
mirror of git://git.suckless.org/svkbd synced 2024-12-18 04:04:44 +00:00

protection against segfault if overlay has more keys than the keyboard itself

This commit is contained in:
Maarten van Gompel 2021-07-11 17:53:44 +02:00 committed by Hiltjo Posthuma
parent b70948b74c
commit 2164466746

View File

@ -1062,6 +1062,8 @@ showoverlay(int idx)
j++; j++;
if (overlay[i].width > 1) if (overlay[i].width > 1)
j += overlay[i].width - 1; j += overlay[i].width - 1;
if (j >= numkeys)
break;
keys[j].label = overlay[i].label; keys[j].label = overlay[i].label;
keys[j].label2 = overlay[i].label2; keys[j].label2 = overlay[i].label2;
keys[j].keysym = overlay[i].keysym; keys[j].keysym = overlay[i].keysym;