mirror of
https://gitlab.freedesktop.org/xorg/lib/libx11.git
synced 2026-05-07 20:18:03 +02:00
libX11/XKBNames.c fix: dereferenced before check
* Do not use variables before checked for NULL. Signed-off-by: Harms <wharms@bfs,de> Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com> Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
This commit is contained in:
parent
b3c9f6a17e
commit
a3808f5151
1 changed files with 7 additions and 2 deletions
|
|
@ -778,9 +778,14 @@ XkbNoteNameChanges(XkbNameChangesPtr old,
|
|||
{
|
||||
int first, last, old_last, new_last;
|
||||
|
||||
wanted &= new->changed;
|
||||
if ((old == NULL) || (new == NULL) || (wanted == 0))
|
||||
if ((old == NULL) || (new == NULL))
|
||||
return;
|
||||
|
||||
wanted &= new->changed;
|
||||
|
||||
if (wanted == 0)
|
||||
return;
|
||||
|
||||
if (wanted & XkbKeyTypeNamesMask) {
|
||||
if (old->changed & XkbKeyTypeNamesMask) {
|
||||
new_last = (new->first_type + new->num_types - 1);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue