summaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2023-09-12Ensure XRenderInfo pointers are appropriately alignedHEADmasterAlex Richardson1-12/+19
While runnig some X11 applications on an Arm Morello platform I noticed bus errors inside xrender. XRenderInfo uses a single malloc call to allocate multiple objects in one single allocation and places those objects directly after the XRenderInfo object. However, these calculations do not ensure that this objects are sufficiently aligned. I noticed this because on Morello (and other CHERI-enabled architectures) pointers need to be strongly aligned. Instead of allocating a single block with potentially misaligned subsequent objects, this change uses seprate allocations for the four arrays. This is an alternative to https://gitlab.freedesktop.org/xorg/lib/libxrender/-/merge_requests/12 Signed-off-by: Alex Richardson <arichardson@FreeBSD.org>
2023-03-07configure: Use LT_INIT from libtool 2 instead of deprecated AC_PROG_LIBTOOLAlan Coopersmith1-1/+2
AC_PROG_LIBTOOL was replaced by LT_INIT in libtool 2 in 2008, so it's time to rely on it. Clears autoconf warnings: configure.ac:45: warning: The macro `AC_PROG_LIBTOOL' is obsolete. configure.ac:45: You should run autoupdate. aclocal.m4:3465: AC_PROG_LIBTOOL is expanded from... configure.ac:45: the top level libtoolize: Consider adding 'AC_CONFIG_MACRO_DIRS([m4])' to configure.ac, libtoolize: and rerunning libtoolize and aclocal. Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2022-10-21libXrender 0.9.11libXrender-0.9.11Alan Coopersmith1-2/+3
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2022-09-11fix regressionThomas E. Dickey1-87/+87
Signed-off-by: Thomas E. Dickey <dickey@invisible-island.net>
2022-09-11WIP: DocumentationOliver Hattshire5-405/+3631
2022-09-11whitespace fixThomas E. Dickey7-27/+27
Signed-off-by: Thomas E. Dickey <dickey@invisible-island.net>
2022-09-11use _X_UNUSED for compiler-warningsThomas E. Dickey3-4/+8
Signed-off-by: Thomas E. Dickey <dickey@invisible-island.net>
2022-09-11use _Xconst with DataInt32/DataInt16/memcpy to reduce strict compiler warningsThomas E. Dickey7-16/+16
Signed-off-by: Thomas E. Dickey <dickey@invisible-island.net>
2022-09-09use casts to reduce compiler warnings (no object change)Thomas E. Dickey13-252/+252
Signed-off-by: Thomas E. Dickey <dickey@invisible-island.net>
2022-09-08cppcheck (removing unused assignment lets variable scope reduction)Thomas E. Dickey1-2/+3
Signed-off-by: Thomas E. Dickey <dickey@invisible-island.net>
2022-09-08additional cppcheck-scope warningThomas E. Dickey1-1/+3
Signed-off-by: Thomas E. Dickey <dickey@invisible-island.net>
2022-09-08amend cppcheck-scope change, fixing c89 buildThomas E. Dickey4-25/+41
Signed-off-by: Thomas E. Dickey <dickey@invisible-island.net>
2022-09-07Rename xDepth to xPDepth to quiet -Wshadow warningsAlan Coopersmith1-7/+7
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 Coopersmith4-9/+9
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2022-09-07Reduce variable scopes as recommended by cppcheckAlan Coopersmith9-78/+89
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2022-09-07Remove unnecessary casts from malloc & free callsAlan Coopersmith2-4/+4
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 Karasik1-9/+18
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-07-17gitlab CI: add a basic build testAlan Coopersmith1-0/+98
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2022-07-17Fix spelling/wording issuesAlan Coopersmith2-2/+2
Found by using: codespell --builtin clear,rare,usage,informal,code,names Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2022-07-17Build xz tarballs instead of bzip2Alan Coopersmith1-1/+1
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2022-01-07Add missing HAVE_CONFIG_H guard to Xrenderint.hRobin Linden1-1/+3
Signed-off-by: Robin Linden <dev@robinlinden.eu>
2018-12-07Update configure.ac bug URL for gitlab migrationAlan Coopersmith1-1/+1
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2018-11-19Update README for gitlab migrationAlan Coopersmith3-25/+20
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2017-01-26autogen: add default patch prefixMihail Konev1-0/+3
Signed-off-by: Mihail Konev <k.mvc@ya.ru>
2017-01-26autogen.sh: use quoted string variablesEmil Velikov1-4/+4
Place quotes around the $srcdir, $ORIGDIR and $0 variables to prevent fall-outs, when they contain space. Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2017-01-26autogen.sh: use exec instead of waiting for configure to finishPeter Hutterer1-1/+1
Syncs the invocation of configure with the one from the server. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
2016-10-04libXrender 0.9.10libXrender-0.9.10Matthieu Herrb1-1/+1
Signed-off-by: Matthieu Herrb <matthieu.herrb@laas.fr>
2016-09-25Validate lengths while parsing server data.Tobias Stoeckmann1-0/+18
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 Stoeckmann1-1/+12
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>
2015-05-21Fix documentation to explicitly mention premultiplied alphaLauri Kasanen1-1/+4
Before this patch, it wasn't mentioned in this file at all, which is a monumental oversight. Signed-off-by: Lauri Kasanen <cand@gmx.com>
2015-04-30libXrender 0.9.9libXrender-0.9.9Alan Coopersmith1-1/+1
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2013-11-23Fix request length calculation for XRenderCompositeText32Clemens Eisserer1-1/+1
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 Joost2-21/+1
_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-06-13libXrender 0.9.8libXrender-0.9.8Alan Coopersmith1-1/+1
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2013-05-05integer overflow in XRenderQueryPictIndexValues() [CVE-2013-1987 3/3]Alan Coopersmith1-9/+16
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 Coopersmith1-14/+26
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 Coopersmith1-14/+25
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 Coopersmith4-3/+23
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-15autogen.sh: Implement GNOME Build APIColin Walters1-1/+3
http://people.gnome.org/~walters/docs/build-api.txt Signed-off-by: Adam Jackson <ajax@redhat.com>
2013-01-15configure: Remove AM_MAINTAINER_MODEAdam Jackson1-1/+0
Signed-off-by: Adam Jackson <ajax@redhat.com>
2012-03-07libXrender 0.9.7libXrender-0.9.7Alan Coopersmith1-1/+1
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2012-02-28Fix alpha premultiplication in XRenderParseColor.Emanuele Giaquinta1-3/+3
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 Coopersmith15-126/+126
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 Coopersmith1-1/+1
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>
2011-02-02config: comment, minor upgrade, quote and layout configure.acGaetan Nadon1-48/+47
Group statements per section as per Autoconf standard layout Quote statements where appropriate. Autoconf recommends not using dnl instead of # for comments Use AC_CONFIG_FILES to replace the deprecated AC_OUTPUT with parameters. Add AC_CONFIG_SRCDIR([Makefile.am]) Remove redundant AC_SUBST(*_CFLAGS) and/or *_LIBS Update minimum version of util-macros to at least 1.8. No functional configuration changes This helps automated maintenance and release activities. Details can be found in http://wiki.x.org/wiki/NewModuleGuidelines
2011-01-28config: replace deprecated AM_CONFIG_HEADER with AC_CONFIG_HEADERSGaetan Nadon1-1/+1
Signed-off-by: Gaetan Nadon <memsize@videotron.ca>
2011-01-27config: remove AC_PROG_CC as it overrides AC_PROG_C_C99Gaetan Nadon1-1/+0
XORG_STRICT_OPTION from XORG_DEFAULT_OPTIONS calls AC_PROG_C_C99. This sets gcc with -std=gnu99. If AC_PROG_CC macro is called afterwards, it resets CC to gcc. Signed-off-by: Gaetan Nadon <memsize@videotron.ca>
2010-11-04Fix some minor typosAaron Plattner1-3/+3
Signed-off-by: Aaron Plattner <aplattner@nvidia.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-06-08libXrender 0.9.6libXrender-0.9.6Alan Coopersmith1-1/+4
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>