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-22 15:17:48 -0800 |
commit | 5e0432f797d58fe1a69ef538694f65bbba38737f (patch) | |
tree | ea8ac894fd4d67ba8bce5e70c755e03532f04beb | |
parent | 859ced56d9ee168796c2fcf7fa6056e0c1491f3a (diff) |
XQuartz: Avoid passing uninitialized pointers to X11ApplicationSetWindowMenu in AppleWMSetWindowMenu
Signed-off-by: Jeremy Huddleston Sequoia <jeremyhu@apple.com>
(cherry picked from commit 77df653ae3d8448be21221711851acde12c6bc1a)
-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 c4e5f4a71..0d734bd88 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); |