mirror of
https://gitlab.freedesktop.org/xorg/xserver.git
synced 2026-01-03 11:40:15 +01:00
xkb: ensure XkbAllocNames sets num_rg to 0 on allocation failure
If there was a previous radio_groups array which we failed to realloc
and freed instead, clear the array size in the XkbNamesRec.
Taken from xorg/lib/libx11@258a8ced681dc1bc50396be7439fce23f9807e2a
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
(cherry picked from commit 09c6f09eb7)
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1894>
This commit is contained in:
parent
f71114570f
commit
1e52c5c094
1 changed files with 3 additions and 1 deletions
|
|
@ -194,8 +194,10 @@ XkbAllocNames(XkbDescPtr xkb, unsigned which, int nTotalRG, int nTotalAliases)
|
|||
free(prev_radio_groups);
|
||||
}
|
||||
}
|
||||
if (names->radio_groups == NULL)
|
||||
if (names->radio_groups == NULL) {
|
||||
names->num_rg = 0;
|
||||
return BadAlloc;
|
||||
}
|
||||
names->num_rg = nTotalRG;
|
||||
}
|
||||
return Success;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue