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
1 changed files with 2 additions and 0 deletions

View File

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