summaryrefslogtreecommitdiff
path: root/src/XGetFCtl.c
AgeCommit message (Collapse)Author
2016-09-25Properly validate server responses.Tobias Stoeckmann
By validating length fields from server responses, out of boundary accesses and endless loops can be mitigated. Signed-off-by: Tobias Stoeckmann <tobias@stoeckmann.org> Reviewed-by: Matthieu Herrb <matthieu@herrb.eu>
2014-11-03Do not return NoSuchExtension casted to pointer as an error.Michal Srb
Several functions were returning NoSuchExtension casted to a pointer in case of an error. Often in parallel with returning NULL in case of another error. It is undocumented and certainly wrong. Signed-off-by: Michal Srb <msrb@suse.com> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2013-06-28Remove check that can never be true.Thomas Klausner
clang warns: warning: comparison of constant 268435455 with expression of type 'CARD16' (aka 'unsigned short') is always false Signed-off-by: Thomas Klausner <wiz@NetBSD.org> Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2013-05-23integer overflow in XGetFeedbackControl() [CVE-2013-1984 2/8]Alan Coopersmith
If the number of feedbacks reported by the server is large enough that it overflows when multiplied by the size of the appropriate struct, or if the total size of all the feedback structures overflows when added together, then memory corruption can occur when more bytes are copied from the X server reply than the size of the buffer we allocated to hold them. v2: check that reply size fits inside the data read from the server, so we don't read out of bounds either Reported-by: Ilja Van Sprundel <ivansprundel@ioactive.com> Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
2013-05-23Use _XEatDataWords to avoid overflow of rep.length bit shiftingAlan Coopersmith
rep.length is a CARD32, so rep.length << 2 could overflow in 32-bit builds Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
2012-12-10Fix compiler warningsPeter Hutterer
XIQueryVersion.c: In function '_xiQueryVersion': XIQueryVersion.c:63:26: warning: declaration of 'info' shadows a parameter [-Wshadow] XIQueryVersion.c:53:73: warning: shadowed declaration is here [-Wshadow] XExtInt.c: In function 'XInputWireToEvent': XExtInt.c:823:25: warning: declaration of 'i' shadows a previous local [-Wshadow] XExtInt.c:502:18: warning: shadowed declaration is here [-Wshadow] XExtInt.c:850:25: warning: declaration of 'i' shadows a previous local [-Wshadow] XExtInt.c:502:18: warning: shadowed declaration is here [-Wshadow] In file included from XExtInt.c:64:0: ../include/X11/extensions/XInput.h:166:17: note: previous declaration of '_xidevicebusy' was here XExtInt.c:101:12: warning: redundant redeclaration of '_XiGetDevicePresenceNotifyEvent' [-Wredundant-decls] XExtInt.c:76:13: warning: redundant redeclaration of '_xibaddevice' [-Wredundant-decls] In file included from XExtInt.c:64:0: ../include/X11/extensions/XInput.h:162:17: note: previous declaration of '_xibaddevice' was here XExtInt.c:81:13: warning: redundant redeclaration of '_xibadclass' [-Wredundant-decls] In file included from XExtInt.c:64:0: ../include/X11/extensions/XInput.h:163:17: note: previous declaration of '_xibadclass' was here XExtInt.c:86:13: warning: redundant redeclaration of '_xibadevent' [-Wredundant-decls] In file included from XExtInt.c:64:0: ../include/X11/extensions/XInput.h:164:17: note: previous declaration of '_xibadevent' was here XExtInt.c:91:13: warning: redundant redeclaration of '_xibadmode' [-Wredundant-decls] In file included from XExtInt.c:64:0: ../include/X11/extensions/XInput.h:165:17: note: previous declaration of '_xibadmode' was here XExtInt.c:96:13: warning: redundant redeclaration of '_xidevicebusy' [-Wredundant-decls] In file included from XExtInt.c:64:0: ../include/X11/extensions/XInput.h:166:17: note: previous declaration of '_xidevicebusy' was here XListDev.c: In function 'ParseClassInfo': XListDev.c:116:33: warning: declaration of 'k' shadows a previous local [-Wshadow] XListDev.c:109:12: warning: shadowed declaration is here [-Wshadow] XGetFCtl.c: In function 'XGetFeedbackControl': XGetFCtl.c:184:26: warning: declaration of 'i' shadows a previous local [-Wshadow] XGetFCtl.c:72:17: warning: shadowed declaration is here [-Wshadow] Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Dan Nicholson <dbn.lists@gmail.com>
2011-11-12Include config.h from source filesPeter Hutterer
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Gaetan Nadon <memsize@videotron.ca> Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com>
2010-07-13Use single error path in XGetFeedbackControlPauli Nieminen
This reduces code duplication and fixes possible leak of f. f would leak if allocation of Feedback fails. Signed-off-by: Pauli Nieminen <ext-pauli.nieminen@nokia.com> Reviewed-by: Julien Cristau <jcristau@debian.org>
2008-08-13Remove RCS tags.Peter Hutterer
2008-05-20libXi ansification.Paulo Cesar Pereira de Andrade
Thre are still two remaining compiler warnings, because of non matching function prototypes and function pointer arguments prototypes: src/XSndExEv.c:XSendExtensionEvent() variable register Status(**fp) (Display *, XEvent*, xEvent **, int *) doesn't match struct _XDisplay's: Status (*wire_vec[128])( /* vector for event to wire */ Display * /* dpy */, XEvent * /* re */, xEvent * /* event */ ); and src/XExtInt.c:xinput_extension_hooks field event_to_wire of type XExtensionHooks that has the prototype Status (*event_to_wire)( Display* /* display */, XEvent* /* re */, xEvent* /* event */ ); does not match Status _XiEventToWire( register Display *dpy, /* pointer to display structure */ register XEvent *re, /* pointer to client event */ register xEvent **event, /* wire protocol event */ register int *count); Signed-off-by: Peter Hutterer <peter@cs.unisa.edu.au>
2006-10-15Don't call XInput_find_display in _XiCheckExtInit, while the Display lock is ↵Jamey Sharp
held. All callers of _XiCheckExtInit have already called XInput_find_display first outside the lock, so just pass their copy of the XExtDisplayInfo structure down. Besides being more correct, this should be slightly faster. :-) Thanks to Magnus Kessler <Magnus.Kessler@gmx.net> for identifying the bug and proposing a workaround.
2006-07-18fix indentation on function declarationsDaniel Stone
Another brief run with indent.
2006-03-31Mass reindent. Sorry.XORG-7_0_99_901Daniel Stone
2004-04-23Merging XORG-CURRENT into trunkxprint_packagertest_20041217_basexprint_packagertest_20041125_basesco_port_update-baserel-0-6-1lg3d-rel-0-7-0lg3d-rel-0-6-2lg3d-baseXORG-6_8_99_903XORG-6_8_99_902XORG-6_8_99_901XORG-6_8_99_900XORG-6_8_99_9XORG-6_8_99_8XORG-6_8_99_7XORG-6_8_99_6XORG-6_8_99_5XORG-6_8_99_4XORG-6_8_99_3XORG-6_8_99_2XORG-6_8_99_16XORG-6_8_99_15XORG-6_8_99_14XORG-6_8_99_13XORG-6_8_99_12XORG-6_8_99_11XORG-6_8_99_10XORG-6_8_99_1XORG-6_8_2XORG-6_8_1_904XORG-6_8_1_903XORG-6_8_1_902XORG-6_8_1_901XORG-6_8_1XORG-6_8_0XORG-6_7_99_904XORG-6_7_99_903XORG-6_7_99_902XORG-6_7_99_901XORG-6_7_99_2XORG-6_7_99_1XACE-SELINUX-MERGExprint_packagertest_20041217xprint_packagertest_20041125sco_port_updatelg3d-masterlg3d-eventlg3d-dev-0-7-1lg3d-dev-0-7-0lg3d-dev-0-6-latestlg3d-dev-0-6-2lg3d-dev-0-6-1-latestlg3d-dev-0-6-1-currentlg3d-dev-0-6-1-1lg3d-dev-0-6-1lg3dXORG-6_8-branchCOMPOSITEWRAPEgbert Eich
2004-03-14Importing vendor version xf86-4_4_99_1 on Sun Mar 14 00:26:39 PST 2004xf86-4_4_99_1Egbert Eich
2004-03-03Importing vendor version xf86-4_4_0 on Wed Mar 3 04:09:24 PST 2004xf86-4_4_0STSF-CURRENTEgbert Eich
2004-02-26readding XFree86's cvs IDsxf86-4_3_99_903Egbert Eich
2004-02-26Importing vendor version xf86-4_3_99_903 on Wed Feb 26 01:21:00 PST 2004Egbert Eich
2003-11-14XFree86 4.3.0.1xf86-4_3_0_1PRE_xf86-4_3_0_1Kaleb Keithley
2003-11-14R6.6 is the Xorg base-lineXORG-MAINKaleb Keithley