diff options
author | Peter Hutterer <peter.hutterer@who-t.net> | 2012-02-27 08:01:07 +1000 |
---|---|---|
committer | Peter Hutterer <peter.hutterer@who-t.net> | 2012-03-22 11:33:20 +1000 |
commit | 2c23ef83b0e03e163aeeb06133538606886f4e9c (patch) | |
tree | 6dc542e0282ac174c9fc085c4dbb0a12045c02f0 /Xi | |
parent | eb84c154ed38194c32651727b6dfe2d1bde4c599 (diff) |
Xi: prohibit multiple XIQueryVersion requests with different versions
Return BadValue if major or minor differs on the second call.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Chase Douglas <chase.douglas@canonical.com>
Diffstat (limited to 'Xi')
-rw-r--r-- | Xi/xiqueryversion.c | 9 |
1 files changed, 9 insertions, 0 deletions
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; |