mirror of
https://gitlab.freedesktop.org/xorg/xserver.git
synced 2026-04-19 04:20:41 +02:00
XQuartz: Check for allocated memory before using it in AppleWMSetWindowMenu
Signed-off-by: Jeremy Huddleston Sequoia <jeremyhu@apple.com>
This commit is contained in:
parent
64327226dd
commit
3bc608a361
1 changed files with 7 additions and 0 deletions
|
|
@ -378,6 +378,13 @@ ProcAppleWMSetWindowMenu(register ClientPtr client)
|
|||
items = malloc(sizeof(char *) * nitems);
|
||||
shortcuts = malloc(sizeof(char) * nitems);
|
||||
|
||||
if (!items || !shortcuts) {
|
||||
free(items);
|
||||
free(shortcuts);
|
||||
|
||||
return BadAlloc;
|
||||
}
|
||||
|
||||
max_len = (stuff->length << 2) - sizeof(xAppleWMSetWindowMenuReq);
|
||||
bytes = (char *)&stuff[1];
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue