diff options
-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); |