summaryrefslogtreecommitdiff
path: root/src
AgeCommit message (Collapse)AuthorFilesLines
2022-11-20Use calloc instead of malloc to allocate arraysAlan Coopersmith1-2/+2
Makes code more consistent with other functions in this library which already do this and adds extra protection against overflows or failures to properly fill in values. Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2022-11-20Handle implicit conversion warnings from clangAlan Coopersmith1-19/+19
Clears 6 -Wimplicit-int-conversion, 6 -Wshorten-64-to-32, and 7 -Wsign-conversion warnings. Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2022-11-20Resolve -Wsign-compare warnings from gccAlan Coopersmith1-2/+2
XRes.c: In function ‘XResQueryClients’: XRes.c:121:31: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] for (int i = 0; i < rep.num_clients; i++) { ^ XRes.c: In function ‘XResQueryClientResources’: XRes.c:176:31: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] for (int i = 0; i < rep.num_types; i++) { ^ Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2022-11-20Variable scope reductionsAlan Coopersmith1-28/+16
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2022-11-20Reformat code to X.Org standard styleAlan Coopersmith1-159/+148
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2021-03-30Note ABI of XResQueryClientIdsKeith Packard1-0/+1
XResQueryClientIds is now documented to return an array of 32-bit values, not an array of longs. The previous implementation allocated space for 32-bit values but read longs into that, overflowing the array. Applications using this were expecting 32-bit values. This "worked" on little endian 64-bit systems because only one value was typically provided and the low 32-bits got stuck in the right place, although the allocation was overrun at the end. That might cause trouble if the allocator is checking carefully. Signed-off-by: Keith Packard <keithp@keithp.com>
2020-10-21XRes: Use _XRead instead of _XRead32 for reading pidRay Strode1-1/+1
_XRead32 requires the output variable to be a long, but `ReadClientValues` feeds it client->value which is a 32-bit allocation. This commit changes the code to use _XRead instead, which properly handles 32-bit output variables. https://gitlab.freedesktop.org/xorg/lib/libxres/-/issues/3
2013-11-22Remove fallback for _XEatDataWords, require libX11 1.6 for itAlan Coopersmith1-11/+0
_XEatDataWords was orignally introduced with the May 2013 security patches, and in order to ease the process of delivering those, fallback versions of _XEatDataWords were included in the X extension library patches so they could be applied to older versions that didn't have libX11 1.6 yet. Now that we're past that hurdle, we can drop the fallbacks and just require libX11 1.6 for building new versions of the extension libraries. Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2013-07-07Compute number of bytes correctly in XResQueryClientPixmapBytesJulien Cristau1-1/+1
64-bit servers send the upper 32-bit in bytes_overflow. We were multiplying by 2^32 - 1 instead of 2^32 when putting things back together. Debian bug#621702 Reported-by: Kevin Ryde <user42@zip.com.au> Signed-off-by: Julien Cristau <jcristau@debian.org> Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2013-05-06integer overflow in XResQueryClientResources() [CVE-2013-1988 2/2]Alan Coopersmith1-1/+6
The CARD32 rep.num_types needs to be bounds checked before multiplying by sizeof(XResType) to avoid integer overflow leading to underallocation and writing data from the network past the end of the allocated buffer. Reported-by: Ilja Van Sprundel <ivansprundel@ioactive.com> Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2013-05-06integer overflow in XResQueryClients() [CVE-2013-1988 1/2]Alan Coopersmith1-1/+6
The CARD32 rep.num_clients needs to be bounds checked before multiplying by sizeof(XResClient) to avoid integer overflow leading to underallocation and writing data from the network past the end of the allocated buffer. Reported-by: Ilja Van Sprundel <ivansprundel@ioactive.com> Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2013-05-06Use _XEatDataWords to avoid overflow of rep.length shiftingAlan Coopersmith1-2/+14
rep.length is a CARD32, so rep.length << 2 could overflow in 32-bit builds Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2013-01-18Replace deprecated Automake INCLUDES variable with AM_CPPFLAGSAlan Coopersmith1-1/+1
Excerpt https://lists.gnu.org/archive/html/automake/2012-12/msg00038.html - Support for the long-deprecated INCLUDES variable will be removed altogether in Automake 1.14. The AM_CPPFLAGS variable should be used instead. This variable was deprecated in Automake releases prior to 1.10, which is the current minimum level required to build X. Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2012-04-23Implemented second part of XResource extension v1.2: XResQueryResourceBytesErkki Seppälä1-1/+109
Signed-off-by: Erkki Seppälä <erkki.seppala@vincit.fi> Reviewed-by: Rami Ylimäki <rami.ylimaki@vincit.fi> Reviewed-by: Tiago Vignatti <tiago.vignatti@nokia.com> Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2012-04-23Implemented first part of XResource extension v1.2: XResQueryClientIdsErkki Seppälä1-1/+117
Signed-off-by: Erkki Seppälä <erkki.seppala@vincit.fi> Reviewed-by: Rami Ylimäki <rami.ylimaki@vincit.fi> Reviewed-by: Tiago Vignatti <tiago.vignatti@nokia.com> Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2011-11-10Fix gcc -Wwrite-strings warningAlan Coopersmith1-1/+1
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2011-09-16Strip trailing whitespaceAlan Coopersmith1-2/+2
Performed with: find * -type f | xargs perl -i -p -e 's{[ \t]+$}{}' git diff -w & git diff -b show no diffs from this change Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2010-10-06Purge cvs tags.Jesse Adkins1-1/+0
Signed-off-by: Jesse Adkins <jesserayadkins@gmail.com> Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2010-07-08Purge macros NEED_EVENTS and NEED_REPLIESFernando Carrijo1-2/+0
Signed-off-by: Fernando Carrijo <fcarrijo@yahoo.com.br> Acked-by: Tiago Vignatti <tiago.vignatti@nokia.com> Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2010-02-16config: move CWARNFLAGS from configure.ac to Makefile.amGaetan Nadon1-1/+4
Compiler warning flags should be explicitly set in the makefile rather than being merged with other packages compiler flags. Signed-off-by: Gaetan Nadon <memsize@videotron.ca>
2009-10-08Migrate to xorg macros 1.3 & XORG_DEFAULT_OPTIONSAlan Coopersmith1-1/+1
Signed-off-by: Alan Coopersmith <alan.coopersmith@sun.com>
2009-01-30Janitor: Correct make distcheck and remove extra .gitignore files.Paulo Cesar Pereira de Andrade2-8/+2
2008-05-19Rename parameters to clarify QueryVersion/QueryExtension.Peter Hutterer1-8/+8
These parameters are not treated as input. Rename them to make the inner workings slightly more obvious. X.Org Bug 14511 <http://bugs.freedesktop.org/show_bug.cgi?id=14511>
2006-07-13renamed: .cvsignore -> .gitignoreAlan Coopersmith1-0/+0
2006-04-03Bug #6407: Cygwin build fix. (Yaakov Selkowitz)XORG-7_0_99_901Adam Jackson1-1/+1
2005-12-03Add check and cflags for malloc(0) returning NULL.Kevin E Martin1-1/+1
2005-11-01Update pkgcheck dependencies to work with separate build roots.Kevin E Martin1-1/+1
2005-07-16Set soversion to 1.0.0 using -version-number.Daniel Stone1-5/+1
2005-07-12Bump soversion to 1.0.0.Daniel Stone1-1/+1
2005-07-09Add .cvsignore files Switch _la_CFLAGS for AM_CFLAGS to clean up directoryKeith Packard2-1/+7
2005-06-22Apply these patches from Theo van Klaveren:Søren Sandmann Pedersen1-1/+3
lib-dmx.patch lib-FS.patch lib-X11.patch lib-XRes.patch lib-XScrnSaver.patch lib-xtrans.patch to make the libraries distcheck.
2005-06-14XRes/src/Makefile.am: Add $(top_srcdir)/include to INCLUDESSøren Sandmann Pedersen1-0/+2
2005-06-07- symlink.sh: Move XRes.h from proto/Resource toXORG-6_8_99_903XORG-6_8_99_902XORG-6_8_99_901XORG-6_8_99_900XORG-6_8_99_16XORG-6_8_99_15XORG-6_8_99_14XORG-6_8_99_13XORG-6_8_99_12XORG-6_8_99_11Søren Sandmann Pedersen2-0/+19
lib/XRes/include/X11/extensions - symlink.sh: Add XRes linking - xc/lib/XRes/*.c: conditionally include config.h - lib/XRes: add directories and build system.
2004-04-23Merging XORG-CURRENT into trunksco_port_update-baserel-0-6-1lg3d-rel-0-7-0lg3d-rel-0-6-2lg3d-baseXORG-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_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-MERGEXORG-6_8-branchEgbert Eich1-1/+1
2004-03-14Importing vendor version xf86-4_4_99_1 on Sun Mar 14 00:26:39 PST 2004xf86-4_4_99_1Egbert Eich1-1/+1
2004-03-03Importing vendor version xf86-4_4_0 on Wed Mar 3 04:09:24 PST 2004xf86-4_4_0Egbert Eich1-1/+1
2004-02-26readding XFree86's cvs IDsxf86-4_3_99_903Egbert Eich1-1/+1
2004-02-26Importing vendor version xf86-4_3_99_903 on Wed Feb 26 01:21:00 PST 2004Egbert Eich1-1/+1
2003-11-14Initial revisionKaleb Keithley1-0/+230