Bug 7083 - XCreateColormap returns BadValue when it should return BadMatch
Summary: XCreateColormap returns BadValue when it should return BadMatch
Status: RESOLVED FIXED
Alias: None
Product: xorg
Classification: Unclassified
Component: Protocol/Core (show other bugs)
Version: 7.0.0
Hardware: Other Linux (All)
: high trivial
Assignee: Xorg Project Team
QA Contact:
URL:
Whiteboard:
Keywords: 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:
i915 platform:
i915 features:


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

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


Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.