[PATCH xserver v2] Fix id in error when resource does not exist

Adam Jackson ajax at nwnk.net
Thu Oct 6 19:01:28 UTC 2016


On Thu, 2016-10-06 at 14:06 -0400, Peter Harris wrote:
> On 2016-10-06 1:07 PM, Adam Jackson wrote:
> > ... imagine ChangeGC specifying more than one of {tile, stipple, font,
> > clipmask pixmap}.  Whichever one is looked up last will be the
> > errorValue thrown with the eventual BadMatch, which beyond being
> > against the spec also means you might be misled about which resource is
> > failing the match.
> 
> 
> But that's already the case with the current code. When the lookup
> succeeds, client->errorValue is set to whatever was looked up (by the
> line removed in this patch). Yes, the next BadMatch is going to have
> nonsense in a few bytes defined to be padding bytes, but that was
> already the case.
> 
> This patch only moves the setting of client->errorValue above the
> "Resource Not Found" return. So the error definitely[1] isn't BadMatch,
> and we want the ID to be the thing that actually doesn't exist, instead
> of the previous thing that does exist.

Hah, right you are. I think we might still want to clear ->errorValue
on the success path, but that's a bigger thing to audit and can at any
rate be a separate change. Merged:

remote: I: patch #112642 updated using rev 97a8353ec1192d8d3bd2ebb99e5687cb91427e09.
remote: I: 1 patch(es) updated to state Accepted.
To ssh://git.freedesktop.org/git/xorg/xserver
   f4a4115..97a8353  master -> master

- ajax


More information about the xorg-devel mailing list