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:
parent
b70948b74c
commit
2164466746
2
svkbd.c
2
svkbd.c
@ -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;
|
||||||
|
Loading…
Reference in New Issue
Block a user