Bug 7083 - XCreateColormap returns BadValue when it should return BadMatch
XCreateColormap returns BadValue when it should return BadMatch
Status: RESOLVED FIXED
Product: xorg
Classification: Unclassified
Component: Protocol/Core
7.0.0
Other Linux (All)
: high trivial
Assigned To: Xorg Project Team
: patch
Depends on:
Blocks: xorg-7.2
  Show dependency treegraph
 
Reported: 2006-05-31 13:35 UTC by Laurence Withers
Modified: 2006-11-04 09:35 UTC (History)
0 users

See Also:


Attachments
Proposed patch to return correct error message (377 bytes, patch)
2006-05-31 13:36 UTC, Laurence Withers
no flags Details | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Laurence Withers 2006-05-31 13:35:01 UTC
In xorg-server/dix/dispatch.c, the ProcCreateColormap function should return 
BadMatch but actually retuns BadValue. This happens after the for loop.

According to the man page, "[i]f the visual type is not one supported by the 
screen, a BadMatch error results.".

BadValue is (correctly) returned if the alloc parameter is not AllocAll or 
AllocNone.

I'll attach a patch against xorg-server-1.0.2.
Comment 1 Laurence Withers 2006-05-31 13:36:24 UTC
Created attachment 5772 [details] [review]
Proposed patch to return correct error message
Comment 2 Alan Coopersmith 2006-11-03 17:46:13 UTC
The official X11 Protocol Spec agrees:

This request creates a colormap of the specified visual type for the screen
on which the window resides and associates the identifier mid with it.
The visual type must be one supported by the screen (or a Match error results).
Comment 3 Daniel Stone 2006-11-04 09:35:06 UTC
fixed in both master and server-1.2-branch, thanks