summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeremy Huddleston Sequoia <jeremyhu@apple.com>2014-01-01 11:10:41 -0800
committerJeremy Huddleston Sequoia <jeremyhu@apple.com>2014-01-22 15:17:49 -0800
commit4ab897c03389d5e6e23a4ef7f3f6a4fda1837a53 (patch)
treef1960c1c39fde6c5ae93672bf03174ba56130fb4
parentbb315485b451e573a53f04e2281e79f21d33bd02 (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.c9
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);