summaryrefslogtreecommitdiff
path: root/src/XrrProvider.c
AgeCommit message (Collapse)AuthorFilesLines
2022-10-17Remove unnecessary casts of return values from malloc()Alan Coopersmith1-2/+2
Not needed in C89 and later Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2022-10-17XRRGetProviderInfo: Remove unneeded ProviderInfoExtraAlan Coopersmith1-9/+5
It was always 0, hence caused gcc warnings: XrrProvider.c: In function ‘XRRGetProviderInfo’: XrrProvider.c:133:49: warning: comparison of unsigned expression < 0 is always false [-Wtype-limits] if (rep.length > INT_MAX >> 2 || rep.length < ProviderInfoExtra >> 2) ^ XrrProvider.c:135:17: warning: comparison of unsigned expression < 0 is always false [-Wtype-limits] if (rep.length < ProviderInfoExtra >> 2) ^ XrrProvider.c:135:5: warning: this condition has identical branches [-Wduplicated-branches] if (rep.length < ProviderInfoExtra >> 2) ^ Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2016-09-25Avoid out of boundary accesses on illegal responsesTobias Stoeckmann1-4/+24
The responses of the connected X server have to be properly checked to avoid out of boundary accesses that could otherwise be triggered by a malicious server. Signed-off-by: Tobias Stoeckmann <tobias@stoeckmann.org> Reviewed-by: Matthieu Herrb <matthieu@herrb.eu>
2015-03-31libXrandr: Clean up compiler warningsKeith Packard1-4/+4
This removes warnings about shadowing local variables with the same name, and type mismatches with _XRead32. Reviewed-by: Dave Airlie <airlied@redhat.com> Signed-off-by: Keith Packard <keithp@keithp.com>
2013-07-05XRRGetProviderInfo returned bad associated_capability list in 64-bitAlan Coopersmith1-1/+10
Unlike most of the values returned by this function, which are arrays of XIDs (long int), associated_capability is defined as an array of unsigned int. _XRead32 reads 32-bit values from the wire protocol and writes them to the provided buffer as an array of long ints, even if that means expanding them from 32-bit to 64-bit. Doing that for associated_capability resulted in a garbage value between each actual value, and overflowing the provided buffer into the space for the provider name (which is written later and would overwrite the overflowed data). Created xhiv libXrandr/XRRGetProviderInfo test case to test & confirm. Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com> Reviewed-by: Dave Airlie <airlied@redhat.com>
2013-05-03Use _XEatDataWords to avoid overflow of rep.length bit shiftingAlan Coopersmith1-2/+2
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-07-19libXrandr: add support for provider objects.Dave Airlie1-0/+217
This adds the client side libXrandr support for randr 1.4, and provider objects. Signed-off-by: Dave Airlie <airlied@redhat.com>