summaryrefslogtreecommitdiff
path: root/hw/xfree86
diff options
context:
space:
mode:
authorAdam Jackson <ajax@redhat.com>2018-08-29 15:42:20 -0400
committerAdam Jackson <ajax@nwnk.net>2018-09-12 19:31:07 +0000
commit7d689f049c3cc16b8e0cb0103a384a2ceb84ea33 (patch)
tree8babf64b7f59aa917d9de5df6932ccb0f05790fb /hw/xfree86
parentd791c8e5abc174ae589d954b0beb51d232f60019 (diff)
xfree86: Fix Option "MaxClients" validation
The old code would not in fact validate the option value, though it might complain about it in the log. It also didn't let you set some legal values that the -maxclients command line option would. Signed-off-by: Adam Jackson <ajax@redhat.com>
Diffstat (limited to 'hw/xfree86')
-rw-r--r--hw/xfree86/common/xf86Config.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/hw/xfree86/common/xf86Config.c b/hw/xfree86/common/xf86Config.c
index 2c1d335dc..e31030d63 100644
--- a/hw/xfree86/common/xf86Config.c
+++ b/hw/xfree86/common/xf86Config.c
@@ -939,10 +939,12 @@ configServerFlags(XF86ConfFlagsPtr flagsconf, XF86OptionPtr layoutopts)
from = X_CMDLINE;
i = -1;
if (xf86GetOptValInteger(FlagOptions, FLAG_MAX_CLIENTS, &i)) {
- if (i != 64 && i != 128 && i != 256 && i != 512)
- ErrorF("MaxClients must be one of 64, 128, 256 or 512\n");
- from = X_CONFIG;
- LimitClients = i;
+ if (Ones(i) != 1 || i < 64 || i > 2048) {
+ ErrorF("MaxClients must be one of 64, 128, 256, 512, 1024, or 2048\n");
+ } else {
+ from = X_CONFIG;
+ LimitClients = i;
+ }
}
xf86Msg(from, "Max clients allowed: %i, resource mask: 0x%x\n",
LimitClients, RESOURCE_ID_MASK);