path: root/src/XrrProperty.c
AgeCommit message (Collapse)AuthorFilesLines
2022-10-17Remove unnecessary casts of return values from malloc()Alan Coopersmith1-1/+1
Not needed in C89 and later Signed-off-by: Alan Coopersmith <>
2022-10-17Variable scope reductions as recommended by cppcheckAlan Coopersmith1-6/+5
Signed-off-by: Alan Coopersmith <>
2015-03-31libXrandr: Clean up compiler warningsKeith Packard1-1/+1
This removes warnings about shadowing local variables with the same name, and type mismatches with _XRead32. Reviewed-by: Dave Airlie <> Signed-off-by: Keith Packard <>
2013-05-04Make XRRGet*Property() always initialize returned valuesAlan Coopersmith1-1/+7
Avoids memory corruption and other errors when callers access them without checking to see if the calls returned an error value. Callers are still required to check for errors, this just reduces the damage when they don't. (Same as reported against libX11 XGetWindowProperty by Ilja Van Sprundel) Signed-off-by: Alan Coopersmith <>
2013-05-04integer overflow in XRRGetOutputProperty() [CVE-2013-1986 3/4]Alan Coopersmith1-8/+14
If the reported number of properties is too large, the calculations to allocate memory for them may overflow, leaving us returning less memory to the caller than implied by the value written to *nitems. (Same as reported against libX11 XGetWindowProperty by Ilja Van Sprundel) Signed-off-by: Alan Coopersmith <>
2013-05-04integer overflow in XRRQueryOutputProperty() [CVE-2013-1986 1/4]Alan Coopersmith1-4/+9
rep.length is a CARD32, while rbytes was a signed int, so rbytes = sizeof (XRRPropertyInfo) + rep.length * sizeof (long); could result in integer overflow, leading to an undersized malloc and reading data off the connection and writing it past the end of the allocated buffer. Reported-by: Ilja Van Sprundel <> Signed-off-by: Alan Coopersmith <>
2013-05-03Use _XEatDataWords to avoid overflow of rep.length bit shiftingAlan Coopersmith1-5/+4
rep.length is a CARD32, so rep.length << 2 could overflow in 32-bit builds Signed-off-by: Alan Coopersmith <>
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 <>
2009-11-10GetOutputProperty: Return the error code, not BadRequestAdam Jackson1-1/+1
Signed-off-by: Adam Jackson <> Reviewed-by: Jamey Sharp <>
2009-01-30Janitor: make distcheck, compiler warnings, .gitignorePaulo Cesar Pereira de Andrade1-12/+4
Warning corrections are either unused symbols or using an integer as a pointer (generated by sparse).
2008-12-17Be sure to return NULL when returning no properties.Adam Jackson1-1/+1
2007-01-31Merge 64-bit fixes inKeith Packard1-15/+17
2007-01-31Fix read sizes for 64-bit machines.Keith Packard1-30/+30
Be consistent in variable usage: nbytes = network byte length. rbytes = memory byte length. nbytesRead = actual network bytes read. Malloc rbytes data to pass to _XRead*, but use nbytes as the amount of data to read (yes, this is insane, welcome to Xlib). Some of this patch is semi-gratuitous, but the goal is to be consistent everywhere.
2007-01-16Return a valid property info even if we lack valid value sets.Eric Anholt1-16/+18
Previously, XRRQueryOutputProperty90 would return an uninitialized pointer if num_values was 0.
2006-11-30Add initial implementation of crtc gamma and mode adding requests.randr-1.2Keith Packard1-4/+5
They build. More testing seems indicated.
2006-11-20Change properties to have a pending value and report valid values.Keith Packard1-0/+344
Pending values are transferred to current values at mode set, allowing a queue of values to accrue in preparation for the modeset operation while still reporting valid 'current' values for applications. The set of valid values is also available so applications can present a reasonable list to the user during configuration.