summaryrefslogtreecommitdiff
path: root/src
Commit message (Collapse)AuthorAgeFilesLines
* Use calloc instead of malloc to allocate arraysAlan Coopersmith2022-11-201-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>
* Handle implicit conversion warnings from clangAlan Coopersmith2022-11-201-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>
* Resolve -Wsign-compare warnings from gccAlan Coopersmith2022-11-201-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>
* Variable scope reductionsAlan Coopersmith2022-11-201-28/+16
| | | | Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
* Reformat code to X.Org standard styleAlan Coopersmith2022-11-201-159/+148
| | | | Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
* Note ABI of XResQueryClientIdsKeith Packard2021-03-301-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>
* XRes: Use _XRead instead of _XRead32 for reading pidRay Strode2020-10-211-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
* Remove fallback for _XEatDataWords, require libX11 1.6 for itAlan Coopersmith2013-11-221-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>
* Compute number of bytes correctly in XResQueryClientPixmapBytesJulien Cristau2013-07-071-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>
* integer overflow in XResQueryClientResources() [CVE-2013-1988 2/2]Alan Coopersmith2013-05-061-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>
* integer overflow in XResQueryClients() [CVE-2013-1988 1/2]Alan Coopersmith2013-05-061-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>
* Use _XEatDataWords to avoid overflow of rep.length shiftingAlan Coopersmith2013-05-061-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>
* Replace deprecated Automake INCLUDES variable with AM_CPPFLAGSbaserock/morphAlan Coopersmith2013-01-181-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>
* Implemented second part of XResource extension v1.2: XResQueryResourceBytesErkki Seppälä2012-04-231-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>
* Implemented first part of XResource extension v1.2: XResQueryClientIdsErkki Seppälä2012-04-231-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>
* Fix gcc -Wwrite-strings warningAlan Coopersmith2011-11-101-1/+1
| | | | Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
* Strip trailing whitespaceAlan Coopersmith2011-09-161-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>
* Purge cvs tags.Jesse Adkins2010-10-061-1/+0
| | | | | Signed-off-by: Jesse Adkins <jesserayadkins@gmail.com> Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
* Purge macros NEED_EVENTS and NEED_REPLIESFernando Carrijo2010-07-081-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>
* config: move CWARNFLAGS from configure.ac to Makefile.amGaetan Nadon2010-02-161-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>
* Migrate to xorg macros 1.3 & XORG_DEFAULT_OPTIONSAlan Coopersmith2009-10-081-1/+1
| | | | Signed-off-by: Alan Coopersmith <alan.coopersmith@sun.com>
* Janitor: Correct make distcheck and remove extra .gitignore files.Paulo Cesar Pereira de Andrade2009-01-302-8/+2
|
* Rename parameters to clarify QueryVersion/QueryExtension.Peter Hutterer2008-05-191-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>
* renamed: .cvsignore -> .gitignoreAlan Coopersmith2006-07-131-0/+0
|
* Bug #6407: Cygwin build fix. (Yaakov Selkowitz)XORG-7_0_99_901Adam Jackson2006-04-031-1/+1
|
* Add check and cflags for malloc(0) returning NULL.Kevin E Martin2005-12-031-1/+1
|
* Update pkgcheck dependencies to work with separate build roots.Kevin E Martin2005-11-011-1/+1
|
* Set soversion to 1.0.0 using -version-number.Daniel Stone2005-07-161-5/+1
|
* Bump soversion to 1.0.0.Daniel Stone2005-07-121-1/+1
|
* Add .cvsignore files Switch _la_CFLAGS for AM_CFLAGS to clean up directoryKeith Packard2005-07-092-1/+7
|
* Apply these patches from Theo van Klaveren:Søren Sandmann Pedersen2005-06-221-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.
* XRes/src/Makefile.am: Add $(top_srcdir)/include to INCLUDESSøren Sandmann Pedersen2005-06-141-0/+2
|
* - 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 Pedersen2005-06-072-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.
* Merging 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-MERGEsco_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 Eich2004-04-231-1/+1
|
* Importing vendor version xf86-4_4_99_1 on Sun Mar 14 00:26:39 PST 2004xf86-4_4_99_1Egbert Eich2004-03-141-1/+1
|
* Importing vendor version xf86-4_4_0 on Wed Mar 3 04:09:24 PST 2004xf86-4_4_0STSF-CURRENTEgbert Eich2004-03-031-1/+1
|
* readding XFree86's cvs IDsxf86-4_3_99_903Egbert Eich2004-02-261-1/+1
|
* Importing vendor version xf86-4_3_99_903 on Wed Feb 26 01:21:00 PST 2004Egbert Eich2004-02-261-1/+1
|
* Initial revisionKaleb Keithley2003-11-141-0/+230