From 2c23ef83b0e03e163aeeb06133538606886f4e9c Mon Sep 17 00:00:00 2001 From: Peter Hutterer Date: Mon, 27 Feb 2012 08:01:07 +1000 Subject: [PATCH] Xi: prohibit multiple XIQueryVersion requests with different versions Return BadValue if major or minor differs on the second call. Signed-off-by: Peter Hutterer Reviewed-by: Chase Douglas --- Xi/xiqueryversion.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/Xi/xiqueryversion.c b/Xi/xiqueryversion.c index 95a8efa44..fc0ca751b 100644 --- a/Xi/xiqueryversion.c +++ b/Xi/xiqueryversion.c @@ -70,6 +70,15 @@ ProcXIQueryVersion(ClientPtr client) pXIClient = dixLookupPrivate(&client->devPrivates, XIClientPrivateKey); + if (pXIClient->major_version && + (stuff->major_version != pXIClient->major_version || + stuff->minor_version != pXIClient->minor_version)) + { + client->errorValue = stuff->major_version; + return BadValue; + } + + if (version_compare(XIVersion.major_version, XIVersion.minor_version, stuff->major_version, stuff->minor_version) > 0) { major = stuff->major_version;