Skip to content

Commit

Permalink
randr: Initialize RandR even if there are currently no screens attached
Browse files Browse the repository at this point in the history
Failure to do so causes an overvlow in RRClientCallback().

=================================================================
==41262==ERROR: AddressSanitizer: global-buffer-overflow on address 0x000103ccfbc8 at pc 0x0001034f32b9 bp 0x7000035a94c0 sp 0x7000035a94b8
WRITE of size 4 at 0x000103ccfbc8 thread T6
    #0 0x1034f32b8 in RRClientCallback randr.c:72
    #1 0x1038c75e3 in _CallCallbacks dixutils.c:737
    #2 0x10388f406 in CallCallbacks callback.h:83
    #3 0x1038bc49a in NextAvailableClient dispatch.c:3562
    #4 0x103ad094c in AllocNewConnection connection.c:777
    #5 0x103ad1695 in EstablishNewConnections connection.c:863
    #6 0x1038c6630 in ProcessWorkQueue dixutils.c:523
    #7 0x103ab2dbf in WaitForSomething WaitFor.c:175
    #8 0x103880836 in Dispatch dispatch.c:411
    #9 0x1038c2141 in dix_main main.c:301
    #10 0x1032ac75a in server_thread quartzStartup.c:66
    #11 0x7fffc5f16aaa in _pthread_body (libsystem_pthread.dylib+0x3aaa)
    #12 0x7fffc5f169f6 in _pthread_start (libsystem_pthread.dylib+0x39f6)
    #13 0x7fffc5f161fc in thread_start (libsystem_pthread.dylib+0x31fc)

Signed-off-by: Jeremy Huddleston Sequoia <jeremyhu@apple.com>
  • Loading branch information
jeremyhu committed Jul 20, 2017
1 parent 6f373c5 commit e2ef50d
Showing 1 changed file with 0 additions and 3 deletions.
3 changes: 0 additions & 3 deletions randr/randr.c
Expand Up @@ -387,9 +387,6 @@ RRExtensionInit(void)
{
ExtensionEntry *extEntry;

if (RRNScreens == 0)
return;

if (!dixRegisterPrivateKey(&RRClientPrivateKeyRec, PRIVATE_CLIENT,
sizeof(RRClientRec) +
screenInfo.numScreens * sizeof(RRTimesRec)))
Expand Down

0 comments on commit e2ef50d

Please sign in to comment.