~ubuntu-branches/ubuntu/gutsy/vnc4/gutsy

« back to all changes in this revision

Viewing changes to unix/xc/lib/Xrender/Cursor.c

  • Committer: Bazaar Package Importer
  • Author(s): Ola Lundqvist
  • Date: 2006-05-15 20:35:17 UTC
  • mfrom: (1.1.2 upstream)
  • Revision ID: james.westby@ubuntu.com-20060515203517-l4lre1ku942mn26k
Tags: 4.1.1+X4.3.0-10
* Correction of critical security issue. Thanks to Martin Kogler
  <e9925248@student.tuwien.ac.at> that informed me about the issue,
  and provided the patch.
  This flaw was originally found by Steve Wiseman of intelliadmin.com.
* Applied patch from Javier Kohen <jkohen@users.sourceforge.net> that
  inform the user that only 8 first characters of the password will
  actually be used when typing more than 8 characters, closes:
  #355619.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
 * $XFree86: xc/lib/Xrender/Cursor.c,v 1.3 2002/11/24 21:46:15 tsi Exp $
 
3
 *
 
4
 * Copyright � 2002 Keith Packard, member of The XFree86 Project, Inc.
 
5
 *
 
6
 * Permission to use, copy, modify, distribute, and sell this software and its
 
7
 * documentation for any purpose is hereby granted without fee, provided that
 
8
 * the above copyright notice appear in all copies and that both that
 
9
 * copyright notice and this permission notice appear in supporting
 
10
 * documentation, and that the name of Keith Packard not be used in
 
11
 * advertising or publicity pertaining to distribution of the software without
 
12
 * specific, written prior permission.  Keith Packard makes no
 
13
 * representations about the suitability of this software for any purpose.  It
 
14
 * is provided "as is" without express or implied warranty.
 
15
 *
 
16
 * KEITH PACKARD DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
 
17
 * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
 
18
 * EVENT SHALL KEITH PACKARD BE LIABLE FOR ANY SPECIAL, INDIRECT OR
 
19
 * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
 
20
 * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
 
21
 * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
 
22
 * PERFORMANCE OF THIS SOFTWARE.
 
23
 */
 
24
 
 
25
#include "Xrenderint.h"
 
26
 
 
27
Cursor
 
28
XRenderCreateCursor (Display        *dpy,
 
29
                     Picture        source,
 
30
                     unsigned int   x,
 
31
                     unsigned int   y)
 
32
{
 
33
    XExtDisplayInfo             *info = XRenderFindDisplay (dpy);
 
34
    Cursor                      cid;
 
35
    xRenderCreateCursorReq      *req;
 
36
 
 
37
    RenderCheckExtension (dpy, info, 0);
 
38
    LockDisplay(dpy);
 
39
    GetReq(RenderCreateCursor, req);
 
40
    req->reqType = info->codes->major_opcode;
 
41
    req->renderReqType = X_RenderCreateCursor;
 
42
    req->cid = cid = XAllocID (dpy);
 
43
    req->src = source;
 
44
    req->x = x;
 
45
    req->y = y;
 
46
    
 
47
    UnlockDisplay(dpy);
 
48
    SyncHandle();
 
49
    return cid;
 
50
}
 
51
 
 
52
Cursor
 
53
XRenderCreateAnimCursor (Display        *dpy,
 
54
                         int            ncursor,
 
55
                         XAnimCursor    *cursors)
 
56
{
 
57
    XExtDisplayInfo             *info = XRenderFindDisplay (dpy);
 
58
    Cursor                      cid;
 
59
    xRenderCreateAnimCursorReq  *req;
 
60
    long                        len;
 
61
 
 
62
    RenderCheckExtension (dpy, info, 0);
 
63
    LockDisplay(dpy);
 
64
    GetReq(RenderCreateAnimCursor, req);
 
65
    req->reqType = info->codes->major_opcode;
 
66
    req->renderReqType = X_RenderCreateAnimCursor;
 
67
    req->cid = cid = XAllocID (dpy);
 
68
    
 
69
    len = (long) ncursor * SIZEOF (xAnimCursorElt) >> 2;
 
70
    SetReqLen (req, len, len);
 
71
    len <<= 2;
 
72
    Data32 (dpy, (long *) cursors, len);
 
73
    
 
74
    UnlockDisplay(dpy);
 
75
    SyncHandle();
 
76
    return cid;
 
77
}