summaryrefslogtreecommitdiff
path: root/src
Commit message (Collapse)AuthorAgeFilesLines
* Handle implicit conversion warnings from clangAlan Coopersmith2022-11-201-111/+111
| | | | | | | Clears 62 -Wimplicit-int-conversion, 38 -Wshorten-64-to-32, and 11 -Wsign-conversion warnings. Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
* Variable scope reductionsAlan Coopersmith2022-11-201-23/+19
| | | | Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
* XvGetReq: remove trailing semicolon that caller is expected to provideAlan Coopersmith2022-10-171-1/+1
| | | | | | | | | | Clears 20 clang warnings of the form: Xv.c:126:34: warning: empty expression statement has no effect; remove unnecessary ';' to silence this warning [-Wextra-semi-stmt] XvGetReq(QueryExtension, req); ^ Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
* Protocol handling issues in libXv - CVE-2016-5407Tobias Stoeckmann2016-09-281-17/+29
| | | | | | | | | | | | | | | | | | | | The Xv query functions for adaptors and encodings suffer from out of boundary accesses if a hostile X server sends a maliciously crafted response. A previous fix already checks the received length against fixed values but ignores additional length specifications which are stored inside the received data. These lengths are accessed in a for-loop. The easiest way to guarantee a correct processing is by validating all lengths against the remaining size left before accessing referenced memory. This makes the previously applied check obsolete, therefore I removed it. Signed-off-by: Tobias Stoeckmann <tobias@stoeckmann.org> Reviewed-by: Matthieu Herrb <matthieu@herrb.eu>
* Fix typo in dependencies for lint libraryAlan Coopersmith2014-07-281-1/+1
| | | | | | Breaks out of tree lintlib builds by causing VPATH lookup to fail. Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
* Remove fallback for _XEatDataWords, require libX11 1.6 for itAlan Coopersmith2013-07-051-12/+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>
* Refactor error handlingAlan Coopersmith2013-07-051-81/+110
| | | | | | Reduce code duplication, make error checking & cleanup more consistent Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
* Add missing calls to _XEatDataWords when we are skipping _XReadAlan Coopersmith2013-07-051-0/+2
| | | | | | | | If we failed to allocate the buffer to _XRead into, discard the rest of the reply, instead of leaving it to confuse the reading of the next reply. Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
* Replace custom copy of GetReq macro with call to Xlib 1.5's _XGetRequestAlan Coopersmith2013-07-051-9/+6
| | | | | | | | | | | | | | | | | | | | | | | | | xvproto.h names don't match those required by the Xlibint.h GetReq* macros, but at least we can rely on the _XGetRequest function for the bulk of the work now, instead of duplicating it. Also clears clang warnings repeated for every request function: Xv.c:137:5: warning: cast from 'char *' to 'xvQueryExtensionReq *' increases re quired alignment from 1 to 2 [-Wcast-align] XvGetReq(QueryExtension, req); ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ./Xvlibint.h:52:8: note: expanded from macro 'XvGetReq' req = (xv##name##Req *)(dpy->last_req = dpy->bufptr);\ ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Xv.c:137:5: warning: implicit conversion loses integer precision: 'int' to 'CAR D8' (aka 'unsigned char') [-Wconversion] XvGetReq(QueryExtension, req); ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ./Xvlibint.h:53:30: note: expanded from macro 'XvGetReq' req->reqType = info->codes->major_opcode;\ ~ ~~~~~~~~~~~~~^~~~~~~~~~~~ Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
* Require ANSI C89 pre-processor, drop pre-C89 token pasting supportAlan Coopersmith2013-07-051-15/+0
| | | | | Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com> Reviewed-by: Mark Kettenis <kettenis@openbsd.org>
* Use pad_to_int32 macro instead of repeated (x + 3) & ~3 patternAlan Coopersmith2013-07-051-5/+7
| | | | | | | Makes code clearer, and using ~3U instead of ~3 clears some signed int warnings. Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
* Fix sign conversion & comparison warnings from clangAlan Coopersmith2013-07-051-10/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Clears up: Xv.c:196:21: warning: implicit conversion changes signedness: 'CARD32' (aka 'unsigned int') to 'int' [-Wsign-conversion] size = rep.length << 2; ~ ~~~~~~~~~~~^~~~ Xv.c:212:41: warning: implicit conversion changes signedness: 'int' to 'size_t' (aka 'unsigned long') [-Wsign-conversion] if ((pas=(XvAdaptorInfo *)Xmalloc(size))==NULL) { ~~~~~~~~^~~~~ Xv.c:236:43: warning: implicit conversion changes signedness: 'int' to 'unsigned long' [-Wsign-conversion] pa->num_adaptors = rep.num_adaptors - ii; ~ ~~~~~~~~~~~~~~~~~^~~~ Xv.c:243:40: warning: implicit conversion changes signedness: 'int' to 'size_t' (aka 'unsigned long') [-Wsign-conversion] if ( (name = (char *)Xmalloc(size+1)) == NULL) ~~~~~~~~~~~~^~~ Xv.c:251:37: warning: implicit conversion changes signedness: 'int' to 'size_t' (aka 'unsigned long') [-Wsign-conversion] (void)strncpy(name, u.string, size); ~~~~~~~ ^~~~ Xv.c:260:36: warning: implicit conversion changes signedness: 'int' to 'size_t' (aka 'unsigned long') [-Wsign-conversion] if ((pfs=(XvFormat *)Xmalloc(size))==NULL) { ~~~~~~~~^~~~~ Xv.c:269:20: warning: comparison of integers of different signs: 'int' and 'unsigned long' [-Wsign-compare] for (jj=0; jj<pa->num_formats; jj++) { ~~^~~~~~~~~~~~~~~~ Xv.c:259:29: warning: implicit conversion loses integer precision: 'unsigned long' to 'int' [-Wshorten-64-to-32] size = pa->num_formats*sizeof(XvFormat); ~ ~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~ Xv.c:305:16: warning: comparison of integers of different signs: 'int' and 'unsigned long' [-Wsign-compare] for (ii=0; ii<pAdaptors->num_adaptors; ii++, pa++) ~~^~~~~~~~~~~~~~~~~~~~~~~~ Xv.c:356:21: warning: implicit conversion changes signedness: 'CARD32' (aka 'unsigned int') to 'int' [-Wsign-conversion] size = rep.length << 2; ~ ~~~~~~~~~~~^~~~ Xv.c:369:41: warning: implicit conversion changes signedness: 'int' to 'size_t' (aka 'unsigned long') [-Wsign-conversion] if ( (pes = (XvEncodingInfo *)Xmalloc(size)) == NULL) { ~~~~~~~~^~~~~ Xv.c:392:45: warning: implicit conversion changes signedness: 'int' to 'unsigned long' [-Wsign-conversion] pe->num_encodings = rep.num_encodings - jj; ~ ~~~~~~~~~~~~~~~~~~^~~~ Xv.c:397:40: warning: implicit conversion changes signedness: 'int' to 'size_t' (aka 'unsigned long') [-Wsign-conversion] if ( (name = (char *)Xmalloc(size+1)) == NULL) { ~~~~~~~~~~~~^~~ Xv.c:404:31: warning: implicit conversion changes signedness: 'int' to 'size_t' (aka 'unsigned long') [-Wsign-conversion] strncpy(name, u.string, size); ~~~~~~~ ^~~~ Xv.c:433:16: warning: comparison of integers of different signs: 'int' and 'unsigned long' [-Wsign-compare] for (ii=0; ii<pEncodings->num_encodings; ii++, pe++) { ~~^~~~~~~~~~~~~~~~~~~~~~~~~~ Xv.c:886:27: warning: comparison of integers of different signs: 'int' and 'CAR D32' (aka 'unsigned int') [-Wsign-compare] for (i = 0; i < rep.num_attributes; i++) { ~ ^ ~~~~~~~~~~~~~~~~~~ Xv.c:946:27: warning: comparison of integers of different signs: 'int' and 'CAR D32' (aka 'unsigned int') [-Wsign-compare] for (i = 0; i < rep.num_formats; i++) { ~ ^ ~~~~~~~~~~~~~~~ Xv.c:1100:5: warning: comparison of integers of different signs: 'int' and 'unsigned int' [-Wsign-compare] SetReqLen(req, len, len); ^~~~~~~~~~~~~~~~~~~~~~~~ X11/Xlibint.h:530:27: note: expanded from macro 'SetReqLen' if ((req->length + n) > (unsigned)65535) { \ ^ ~~~~~~~~~~~~~~~ Xv.c:1100:20: warning: implicit conversion changes signedness: 'int' to 'unsigned int' [-Wsign-conversion] SetReqLen(req, len, len); ~~~~~~~~~~~~~~~^~~~~~~~~ X11/Xlibint.h:532:21: note: expanded from macro 'SetReqLen' MakeBigReq(req,n) \ ^ X11/Xlibint.h:505:35: note: expanded from macro 'MakeBigReq' ((CARD32 *)req)[1] = _BRlen + n + 2; \ ~ ^ Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
* Remove unnecessary casts from Xmalloc callsAlan Coopersmith2013-07-051-7/+7
| | | | | Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com> Reviewed-by: Mark Kettenis <kettenis@openbsd.org>
* Adopt X.Org standard code style, with consistent indentationAlan Coopersmith2013-06-222-971/+933
| | | | | | Having differing indent levels of 2, 3, & 4 spaces hurts my eyes. Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
* Bug 65252: Ensure final name is nil-terminated & none point to uninitialized ↵Daphne Pfister2013-06-011-2/+6
| | | | | | | | | | | memory. This patch attempts to fix this bug by ensuring that there is at least one nil byte at the end of all the name strings. This should prevent reading past the end of the allocation as well as exposing uninitialized memory. Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com> Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
* XvQueryPortAttributes: add a comment explaining memory strategyAlan Coopersmith2013-06-011-0/+11
| | | | Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
* integer overflow in XvCreateImage() [CVE-2013-1989 3/3]Alan Coopersmith2013-05-071-1/+4
| | | | | | | | | | num_planes is a CARD32 and needs to be bounds checked before bit shifting and adding to sizeof(XvImage) 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>
* integer overflow in XvListImageFormats() [CVE-2013-1989 2/3]Alan Coopersmith2013-05-071-2/+3
| | | | | | | | | | num_formats is a CARD32 and needs to be bounds checked before multiplying by sizeof(XvImageFormatValues) 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>
* buffer overflow in XvQueryPortAttributes() [CVE-2013-2066]Alan Coopersmith2013-05-071-2/+8
| | | | | | | | | | Each attribute returned in the reply includes the number of bytes to read for its marker. We had been always trusting it, and never validating that it wouldn't cause us to write past the end of the buffer we allocated based on the reported text_size. Reported-by: Ilja Van Sprundel <ivansprundel@ioactive.com> Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
* integer overflow in XvQueryPortAttributes() [CVE-2013-1989 1/3]Alan Coopersmith2013-04-261-2/+8
| | | | | | | | | | | The num_attributes & text_size members of the reply are both CARD32s 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>
* Use _XEatDataWords to avoid overflow of rep.length shiftingAlan Coopersmith2013-04-131-3/+19
| | | | | | rep.length is a CARD32, so rep.length << 2 could overflow in 32-bit builds Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
* Fix gcc -Wwrite-strings warningsAlan Coopersmith2011-11-101-2/+2
| | | | Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
* Strip trailing whitespaceAlan Coopersmith2011-09-162-60/+60
| | | | | | | 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-062-3/+0
| | | | | Signed-off-by: Jesse Adkins <jesserayadkins@gmail.com> Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
* Purge macro 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>
* Adjust flags definitions to fix lint library buildAlan Coopersmith2009-05-091-2/+5
| | | | Signed-off-by: Alan Coopersmith <alan.coopersmith@sun.com>
* Janitor: make distcheck, compiler warnings, .gitignore.Paulo Cesar Pereira de Andrade2009-02-021-6/+0
|
* Coverity CID #580: XvQueryEncodings Returned without freeing storage "pes"Alan Coopersmith2006-09-181-0/+1
| | | | | Free the portion of the encoding list we had already filled in if we get an error allocating memory for a list entry.
* Add hooks for running code checkers like sparse & lint over the sourceAlan Coopersmith2006-09-181-0/+18
|
* Add argument types to static function prototypes to clear sparse & lint warningsAlan Coopersmith2006-09-181-3/+4
|
* renamed: .cvsignore -> .gitignoreAlan Coopersmith2006-07-131-0/+0
|
* Add check and cflags for malloc(0) returning NULL.Kevin E Martin2005-12-031-1/+1
|
* Add/improve libs .cvsignores.Eric Anholt2005-11-201-0/+5
|
* Do PKG_CHECK_MODULES on a unique token instead of on "DEP", so builds withAdam Jackson2005-08-031-2/+2
| | | | a global configure cache don't get confused.
* Set soversion to 1.0.0 with -version-number.Daniel Stone2005-07-161-1/+1
|
* Add Xvlib.h, change soversion to 1.0.0.Daniel Stone2005-07-121-4/+2
|
* Add .cvsignore files Switch _la_CFLAGS for AM_CFLAGS to clean up directoryKeith Packard2005-07-092-1/+2
|
* Add Xtrans definitions (FONT_t, TRANS_CLIENT) to clean up warnings.XORG-6_8_99_900XORG-6_8_99_16XORG-6_8_99_15XORG-6_8_99_14Daniel Stone2005-07-031-1/+1
| | | | | | | | Add XSERV_t, TRANS_SERVER, TRANS_REOPEN to quash warnings. Add #include <dix-config.h> or <xorg-config.h>, as appropriate, to all source files in the xserver/xorg tree, predicated on defines of HAVE_{DIX,XORG}_CONFIG_H. Change all Xfont includes to <X11/fonts/foo.h>.
* Add appropriate lib*_CFLAGS to Makefile.am's -- fixes build problemsKevin E Martin2005-07-021-0/+1
|
* xtrap.pc.in: s/Xfixes/XTrap/ xi.pc.in: s/Xt/Xi/ Xv/src/Makefile.am: removeSøren Sandmann Pedersen2005-07-011-1/+1
| | | | | | | whitespace after backslash modularizeapp.sh: s/destkop/desktop/ modular/symlink.sh: Add bitmaps for xeyes, system.xsm for xsm, and Xvidtune.cpp for xvidtune. Also comment out non-existing mga_bios.h Check in buildsystems for xsetroot, xsm, xstdcmap, xtrap, and xvinfo
* - Add Xv to symlink.shSøren Sandmann Pedersen2005-06-131-0/+11
| | | | - Add Xv 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_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-MERGEXORG-6_8-branchEgbert Eich2004-04-232-2/+3
|
* Importing vendor version xf86-4_4_99_1 on Sun Mar 14 00:26:39 PST 2004xf86-4_4_99_1Egbert Eich2004-03-142-2/+2
|
* Importing vendor version xf86-4_4_0 on Wed Mar 3 04:09:24 PST 2004xf86-4_4_0Egbert Eich2004-03-032-2/+2
|
* readding XFree86's cvs IDsxf86-4_3_99_903Egbert Eich2004-02-262-2/+2
|
* Importing vendor version xf86-4_3_99_903 on Wed Feb 26 01:21:00 PST 2004Egbert Eich2004-02-262-2/+2
|
* XFree86 4.3.99.901 (RC 1)xf86-4_3_99_903_specialxf86-4_3_99_902xf86-4_3_99_901xf86-012804-2330Kaleb Keithley2003-12-041-1/+2
|
* XFree86 4.3.99.16 Bring the tree up to date for the Cygwin folksxf86-4_3_99_16Kaleb Keithley2003-11-251-1/+2
|
* Initial revisionXORG-STABLEKaleb Keithley2003-11-142-0/+1228