summaryrefslogtreecommitdiff
path: root/src
AgeCommit message (Collapse)Author
2022-09-11whitespace fixThomas E. Dickey
Signed-off-by: Thomas E. Dickey <dickey@invisible-island.net>
2022-09-11use _X_UNUSED for compiler-warningsThomas E. Dickey
Signed-off-by: Thomas E. Dickey <dickey@invisible-island.net>
2022-09-11use _Xconst with DataInt32/DataInt16/memcpy to reduce strict compiler warningsThomas E. Dickey
Signed-off-by: Thomas E. Dickey <dickey@invisible-island.net>
2022-09-09use casts to reduce compiler warnings (no object change)Thomas E. Dickey
Signed-off-by: Thomas E. Dickey <dickey@invisible-island.net>
2022-09-08cppcheck (removing unused assignment lets variable scope reduction)Thomas E. Dickey
Signed-off-by: Thomas E. Dickey <dickey@invisible-island.net>
2022-09-08additional cppcheck-scope warningThomas E. Dickey
Signed-off-by: Thomas E. Dickey <dickey@invisible-island.net>
2022-09-08amend cppcheck-scope change, fixing c89 buildThomas E. Dickey
Signed-off-by: Thomas E. Dickey <dickey@invisible-island.net>
2022-09-07Rename xDepth to xPDepth to quiet -Wshadow warningsAlan Coopersmith
Xrender.c: In function ‘XRenderQueryFormats’: Xrender.c:406:19: warning: declaration of ‘xDepth’ shadows a global declaration [-Wshadow] xPictDepth *xDepth; ^~~~~~ In file included from /net/also.us.oracle.com/export/alanc/X.Org/amd64-gcc/install/usr/X11R7/include/X11/Xlibint.h:43:0, from Xrenderint.h:31, from Xrender.c:28: /net/also.us.oracle.com/export/alanc/X.Org/amd64-gcc/install/usr/X11R7/include/X11/Xproto.h:329:7: note: shadowed declaration is here } xDepth; ^~~~~~ Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2022-09-07Resolve -Wsign-compare warningsAlan Coopersmith
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2022-09-07Reduce variable scopes as recommended by cppcheckAlan Coopersmith
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2022-09-07Remove unnecessary casts from malloc & free callsAlan Coopersmith
These are not needed in C89 and later Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2022-07-18fix coredumps in XRenderComputeTrapezoids (issue #1)Dmitry Karasik
Rationale: I don't have enough expertise to judge on how the tessellation algorithm is broken in XRenderComputeTrapezoids but I do trust Keith Packard that it is. However using cairo for proper tessellation, as he suggests, is too heavyweight, and here I propose to alter the code to at least do not cause coredumps. Even if/when the function will be marked as obsolete, I believe it is pretty much capable of rendering relatively simple shapes, and still retains some value.
2022-01-07Add missing HAVE_CONFIG_H guard to Xrenderint.hRobin Linden
Signed-off-by: Robin Linden <dev@robinlinden.eu>
2016-09-25Validate lengths while parsing server data.Tobias Stoeckmann
Individual lengths inside received server data can overflow the previously reserved memory. It is therefore important to validate every single length field to not overflow the previously agreed sum of all invidual length fields. v2: consume remaining bytes in the reply buffer on error. Signed-off-by: Tobias Stoeckmann <tobias@stoeckmann.org> Reviewed-by: Matthieu Herrb@laas.fr
2016-09-25Avoid OOB write in XRenderQueryFiltersTobias Stoeckmann
The memory for filter names is reserved right after receiving the reply. After that, filters are iterated and each individual filter name is stored in that reserved memory. The individual name lengths are not checked for validity, which means that a malicious server can reserve less memory than it will write to during each iteration. v2: consume remaining bytes in reply buffer on error. Signed-off-by: Tobias Stoeckmann <tobias@stoeckmann.org> Reviewed-by: Matthieu Herrb <matthieu@herrb.eu>
2013-11-23Fix request length calculation for XRenderCompositeText32Clemens Eisserer
Request length calculation inside XRenderCompositeText32 is broken for the case where the number of glyphs fits exactky inside the last xGlyphElt. In XRenderCompositeText8 and XRenderCompositeText16 this case is handled properly, somehow the "-1" got missing in XRenderCompositeText32. Reviewed-by: Keith Packard <keithp@keithp.com>
2013-11-22Remove fallback for _XEatDataWords, require libX11 1.6 for itMichael Joost
_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. Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com> Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2013-05-05integer overflow in XRenderQueryPictIndexValues() [CVE-2013-1987 3/3]Alan Coopersmith
The length and numIndexValues members of the reply are both CARD32 and need to be bounds checked before multiplying by sizeof (XIndexValue) 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-05integer overflow in XRenderQueryFormats() [CVE-2013-1987 2/3]Alan Coopersmith
The length, numFormats, numScreens, numDepths, and numVisuals members of the reply are all CARD32 and need to be bounds checked before multiplying and adding them together to come up with the total size to allocate, 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-03integer overflow in XRenderQueryFilters() [CVE-2013-1987 1/3]Alan Coopersmith
The length, numFilters & numAliases members of the reply are all CARD32 and need to be bounds checked before multiplying & adding them together to come up with the total size to allocate, 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-03Use _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>
2012-02-28Fix alpha premultiplication in XRenderParseColor.Emanuele Giaquinta
Due to C arithmetic conversion rules we must use an unsigned constant (or a cast) to perform the multiplication using unsigned arithmetic. Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com>
2011-09-16Strip trailing whitespaceAlan Coopersmith
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>
2011-05-22Make DEPTH_MASK generate unsigned intsAlan Coopersmith
Clears Sun compiler warning: "Xrender.c", line 127: warning: integer overflow detected: op "<<" since 1 << 31 overflows a signed 32-bit int. Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2010-07-08Purge macros NEED_EVENTS and NEED_REPLIESFernando Carrijo
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-04-09Always call SyncHandle after issuing an X request.Jamey Sharp
2009-10-01Migrate to xorg macros 1.3 & XORG_DEFAULT_OPTIONSAlan Coopersmith
Signed-off-by: Alan Coopersmith <alan.coopersmith@sun.com>
2009-01-30Janitor: make distcheck, compiler warnings, .gitignore.Paulo Cesar Pereira de Andrade
2008-04-18Use Data instead of Data32 to avoid truncating the filter parameters on ↵Pierre-Loup Griffais
64-bit systems. Signed-off-by: Aaron Plattner <aplattner@nvidia.com>
2008-03-09nuke RCS IdsMatthieu Herrb
2007-08-20Properly set length field in gradient requests (bug 9526).David Reveman
2006-09-16Const-ified the filter argument to XRenderSetPictureFilter().Tilman Sauerbeck
2006-07-13renamed: .cvsignore -> .gitignoreAlan Coopersmith
2006-04-03Coverity #428: Fix a potential NULL chase. Coverity #930: Verify that aXORG-7_0_99_901Adam Jackson
malloc succeeds.
2005-12-03Add check and cflags for malloc(0) returning NULL.Kevin E Martin
2005-07-23Modify modular libs to use Xregion.h instead of region.hKevin E Martin
2005-07-23lib/Xrender/Picture.c Change region.h to Xregion.h and modify internalXORG-6_8_99_903XORG-6_8_99_902XORG-6_8_99_901XORG-6_8_99_900XORG-6_8_99_16Kevin E Martin
references to include <X11/Xregion.h>.
2005-07-19Use correct path to region.h.Daniel Stone
2005-07-09Add .cvsignore filesKeith Packard
2005-07-01Add support for gradients and solid fills to Render.Lars Knoll
2005-06-09Use $(top_srcdir)/... instead of $(top_builddir)/... in INCLUDES AddedAlexander Gottwald
$(top_srcdir) to INCLUDES
2005-05-19- Add Xrender build systemSøren Sandmann Pedersen
2005-05-19- Conditionally include config.h in xc/lib/Xrender/*.cXORG-6_8_99_9XORG-6_8_99_8XORG-6_8_99_13XORG-6_8_99_12XORG-6_8_99_11XORG-6_8_99_10Søren Sandmann Pedersen
- Add Xrender to symlink.sh
2004-12-04Encoding of numerous files changed to UTF-8xprint_packagertest_20041217_basesco_port_update-baseXORG-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_1xprint_packagertest_20041217sco_port_updateMarkus Kuhn
2004-08-07Update to version 0.9 of Xrender (includes XRenderAddTraps)xprint_packagertest_20041125_baserel-0-6-1lg3d-rel-0-7-0lg3d-rel-0-6-2lg3d-baseXORG-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_1xprint_packagertest_20041125lg3d-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-branchKeith Packard
2004-05-24Muffle compiler warnings.COMPOSITEWRAPEgbert Eich
fix option name in log message. improve debugging messages.
2004-04-23Merging XORG-CURRENT into trunkXACE-SELINUX-MERGEEgbert 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