diff options
author | Jeremy Huddleston Sequoia <jeremyhu@apple.com> | 2014-01-01 11:10:41 -0800 |
---|---|---|
committer | Jeremy Huddleston Sequoia <jeremyhu@apple.com> | 2014-01-12 23:12:49 -0800 |
commit | 77df653ae3d8448be21221711851acde12c6bc1a (patch) | |
tree | cafa4930daf6f6e54d928998fcdd352f0692b059 | |
parent | 3bc608a361a01043b226fb9aaebf88f6fd852925 (diff) |
XQuartz: Avoid passing uninitialized pointers to X11ApplicationSetWindowMenu in AppleWMSetWindowMenu
Signed-off-by: Jeremy Huddleston Sequoia <jeremyhu@apple.com>
-rw-r--r-- | hw/xquartz/applewm.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/hw/xquartz/applewm.c b/hw/xquartz/applewm.c index 9ff0ff650..cc91c9608 100644 --- a/hw/xquartz/applewm.c +++ b/hw/xquartz/applewm.c @@ -398,6 +398,15 @@ ProcAppleWMSetWindowMenu(register ClientPtr client) break; } } + + /* Check if we bailed out of the above loop due to a request that was too long */ + if (j < nitems) { + free(items); + free(shortcuts); + + return BadRequest; + } + X11ApplicationSetWindowMenu(nitems, items, shortcuts); free(items); free(shortcuts); |