Bug 7083

Summary: XCreateColormap returns BadValue when it should return BadMatch
Product: xorg Reporter: Laurence Withers <l>
Component: Protocol/CoreAssignee: Xorg Project Team <xorg-team>
Status: RESOLVED FIXED QA Contact:
Severity: trivial    
Priority: high Keywords: patch
Version: 7.0.0   
Hardware: Other   
OS: Linux (All)   
Whiteboard:
i915 platform: i915 features:
Bug Depends on:    
Bug Blocks: 6666    
Attachments:
Description Flags
Proposed patch to return correct error message none

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.