[Bug 2081] New: Wrong argument types in declaration and realisation (tested on XSetScreenSaver())

bugzilla-daemon at freedesktop.org bugzilla-daemon at freedesktop.org
Wed Dec 15 08:08:59 PST 2004


Please do not reply to this email: if you want to comment on the bug, go to          
the URL shown below and enter yourcomments there.   
 
https://bugs.freedesktop.org/show_bug.cgi?id=2081        
   
           Summary: Wrong argument types in declaration and realisation
                    (tested on XSetScreenSaver())
           Product: xorg
           Version: unspecified
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Lib/other
        AssignedTo: xorg-bugzilla-noise at freedesktop.org
        ReportedBy: raorn at altlinux.ru


Rumours says, that XSetScreenSaver() accepts int's as timeout and interval
arguments.  In fact, these values are limited to signed short int:

xc/lib/X11/SetSSaver.c:
int
XSetScreenSaver(dpy, timeout, interval, prefer_blank, allow_exp)
    register Display *dpy;
    int timeout, interval, prefer_blank, allow_exp;

{
    register xSetScreenSaverReq *req;

    LockDisplay(dpy);
    GetReq(SetScreenSaver, req);
    req->timeout = timeout;
    req->interval = interval;
    req->preferBlank = prefer_blank;
    req->allowExpose = allow_exp;
    UnlockDisplay(dpy);
    SyncHandle();
    return 1;
}

xc/include/Xproto.h:
typedef struct {
    CARD8 reqType;
    BYTE pad;
    CARD16 length B16;
    INT16 timeout B16, interval B16;
    BYTE preferBlank, allowExpose;
    CARD16 pad2 B16;
} xSetScreenSaverReq;

INT16 and B16 are defined in xc/include/Xmd.h

Steps to reproduce:
$ xset s 43200 0
X Error of failed request:  BadValue (integer parameter out of range for operation)
  Major opcode of failed request:  107 (X_SetScreenSaver)
  Value in failed request:  0xffffa8c0
  Serial number of failed request:  8
  Current serial number in output stream:  9

43200 - timeout value (12 hours),  0xffffa8c0 - 43200 (0x0000a8c0) threated as
signed short value.        
   
   
--         
Configure bugmail: https://bugs.freedesktop.org/userprefs.cgi?tab=email       
   
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.


More information about the xorg-bugzilla-noise mailing list