1. 09 Nov, 2015 2 commits
  2. 30 Oct, 2015 4 commits
  3. 28 Oct, 2015 3 commits
  4. 27 Oct, 2015 4 commits
  5. 26 Oct, 2015 2 commits
  6. 21 Oct, 2015 5 commits
  7. 19 Oct, 2015 19 commits
    • Jeremy Huddleston Sequoia's avatar
      Xi: Silence some tautological warnings · ee06f674
      Jeremy Huddleston Sequoia authored
      xichangehierarchy.c:424:23: warning: comparison of constant 536870911 with expression of type 'uint16_t'
            (aka 'unsigned short') is always false [-Wtautological-constant-out-of-range-compare,Semantic Issue]
          if (stuff->length > (INT_MAX >> 2))
              ~~~~~~~~~~~~~ ^ ~~~~~~~~~~~~~~
      xichangehierarchy.c:438:26: warning: comparison of constant 536870911 with expression of type 'uint16_t'
            (aka 'unsigned short') is always false [-Wtautological-constant-out-of-range-compare,Semantic Issue]
              if ((any->length > (INT_MAX >> 2)) || (len < (any->length << 2)))
                   ~~~~~~~~~~~ ^ ~~~~~~~~~~~~~~
      Signed-off-by: 's avatarJeremy Huddleston Sequoia <jeremyhu@apple.com>
      Reviewed-by: 's avatarPeter Hutterer <peter.hutterer@who-t.net>
      Signed-off-by: 's avatarPeter Hutterer <peter.hutterer@who-t.net>
      ee06f674
    • Samuel Thibault's avatar
      hurd: fix xorg-wrapper build · 113c0bb4
      Samuel Thibault authored
      hurd does not have any PATH_MAX limitation. misc.h provides a default value
      which is fine here.
      Reviewed-by: 's avatarAdam Jackson <ajax@redhat.com>
      Signed-off-by: 's avatarSamuel Thibault <samuel.thibault@ens-lyon.org>
      113c0bb4
    • Keith Packard's avatar
      fonts: Continue when font calls return Suspended more than once · f9a04d19
      Keith Packard authored
      Patch 3ab6cd31 fixed Xinerama
      interactions with font servers by not putting clients to sleep
      multiple times. However, it introduced additional changes dealing with
      libXfont routine returning Suspended more than once for the same
      request. This additional change was to abandon processing of the
      current request and free the closure data by jumping to
      'xinerama_sleep' in each of the functions.
      
      Font library functions shouldn't return Suspended more than once,
      except for ListFontsWithInfo, which produces multiple replies, and
      thus ends up returning Suspended many times during processing.
      
      With the jump to xinerama_sleep occurring after the first reply was
      processed, the closure for the request was freed and future calls into
      the ListFontsWithInfo callback resulted in dereferencing freed
      memory.
      
      This patch removes the added branches, reverting the code to its
      previous behaviour, which permitted multiple Suspended returns and
      simply waited for the client to be signaled again so that the callback
      could continue processing the request.
      Signed-off-by: 's avatarKeith Packard <keithp@keithp.com>
      Reviewed-by: 's avatarAdam Jackson <ajax@redhat.com>
      f9a04d19
    • Adam Jackson's avatar
      5b582a4a
    • Julien Cristau's avatar
      xorg-wrapper: when starting the server as root, reset its environment · 1d4aa672
      Julien Cristau authored
      When the server is privileged, we shouldn't be passing the user's
      environment directly.
      
      Clearing the environment is recommended by the libdbus maintainers, see
      https://bugs.freedesktop.org/show_bug.cgi?id=52202
      
      v2: rename envp to empty_envp (Jeremy)
      Reviewed-by: 's avatarHans de Goede <hdegoede@redhat.com>
      Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=83849Signed-off-by: Julien Cristau's avatarJulien Cristau <jcristau@debian.org>
      1d4aa672
    • Samuel Thibault's avatar
    • Samuel Thibault's avatar
      a4cd8ee5
    • Jeremy Huddleston Sequoia's avatar
    • Jeremy Huddleston Sequoia's avatar
      XQuartz: Make sure that darwin_all_modifier_mask_additions is 0-terminated · 3db7e332
      Jeremy Huddleston Sequoia authored
      Found by ASan
      
      X.Org X Server 1.17.99.901 Build Date: 20151018
      ================================================================
      ==40471==ERROR: AddressSanitizer: global-buffer-overflow on address 0x000101fed7a4 at pc 0x000101584030 bp 0x70000029f920 sp 0x70000029f918
      READ of size 4 at 0x000101fed7a4 thread T7
          #0 0x10158402f in DarwinEQInit darwinEvents.c:377
          #1 0x10157f3bc in InitInput darwin.c:566
          #2 0x101be87ad in dix_main main.c:268
          #3 0x10159131b in server_thread quartzStartup.c:66
          #4 0x7fff8a535c12 in _pthread_body (/usr/lib/system/libsystem_pthread.dylib+0x3c12)
          #5 0x7fff8a535b8f in _pthread_start (/usr/lib/system/libsystem_pthread.dylib+0x3b8f)
          #6 0x7fff8a533374 in thread_start (/usr/lib/system/libsystem_pthread.dylib+0x1374)
      
      0x000101fed7a4 is located 0 bytes to the right of global variable 'darwin_all_modifier_mask_additions' defined in 'darwinEvents.c:181:12'
      (0x101fed7a0) of size 4
      SUMMARY: AddressSanitizer: global-buffer-overflow darwinEvents.c:377 DarwinEQInit
      Shadow bytes around the buggy address:
        0x1000203fdaa0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
        0x1000203fdab0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
        0x1000203fdac0: f9 f9 f9 f9 00 00 00 00 00 00 f9 f9 f9 f9 f9 f9
        0x1000203fdad0: 00 00 00 00 00 00 00 00 f9 f9 f9 f9 00 00 00 00
        0x1000203fdae0: 00 00 f9 f9 f9 f9 f9 f9 00 00 00 00 00 f9 f9 f9
      =>0x1000203fdaf0: f9 f9 f9 f9[04]f9 f9 f9 f9 f9 f9 f9 00 00 00 00
        0x1000203fdb00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
        0x1000203fdb10: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
        0x1000203fdb20: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
        0x1000203fdb30: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
        0x1000203fdb40: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
      Shadow byte legend (one shadow byte represents 8 application bytes):
        Addressable:           00
        Partially addressable: 01 02 03 04 05 06 07
        Heap left redzone:       fa
        Heap right redzone:      fb
        Freed heap region:       fd
        Stack left redzone:      f1
        Stack mid redzone:       f2
        Stack right redzone:     f3
        Stack partial redzone:   f4
        Stack after return:      f5
        Stack use after scope:   f8
        Global redzone:          f9
        Global init order:       f6
        Poisoned by user:        f7
        Container overflow:      fc
        Array cookie:            ac
        Intra object redzone:    bb
        ASan internal:           fe
        Left alloca redzone:     ca
        Right alloca redzone:    cb
      Thread T7 created by T0 here:
          #0 0x10242ee99 in wrap_pthread_create
      (/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/7.0.0/lib/darwin/libclang_rt.asan_osx_dynamic.dylib+0x37e99)
          #1 0x101591089 in create_thread quartzStartup.c:78
          #2 0x101590ed9 in QuartzInitServer quartzStartup.c:95
          #3 0x1015697eb in X11ApplicationMain X11Application.m:1277
          #4 0x101575dc0 in X11ControllerMain X11Controller.m:984
          #5 0x10159171a in server_main quartzStartup.c:127
          #6 0x101540fc0 in do_start_x11_server bundle-main.c:436
          #7 0x101544869 in _Xstart_x11_server mach_startupServer.c:189
          #8 0x101545c96 in mach_startup_server mach_startupServer.c:398
          #9 0x7fff8d1b70f3 in mach_msg_server (/usr/lib/system/libsystem_kernel.dylib+0x110f3)
          #10 0x1015416e7 in main bundle-main.c:774
          #11 0x7fff8bd975ac in start (/usr/lib/system/libdyld.dylib+0x35ac)
          #12 0x0  (<unknown module>)
      Signed-off-by: 's avatarJeremy Huddleston Sequoia <jeremyhu@apple.com>
      3db7e332
    • Jeremy Huddleston's avatar
      osinit: Silence -Wunused-variable warnings · ec629411
      Jeremy Huddleston authored
      osinit.c:161:24: warning: unused variable 'devnull' [-Wunused-variable,Unused Entity Issue]
          static const char *devnull = "/dev/null";
                             ^
      osinit.c:162:10: warning: unused variable 'fname' [-Wunused-variable,Unused Entity Issue]
          char fname[PATH_MAX];
               ^
      Reviewed-by: 's avatarAdam Jackson <ajax@redhat.com>
      Signed-off-by: 's avatarJeremy Huddleston Sequoia <jeremyhu@apple.com>
      ec629411
    • Jeremy Huddleston's avatar
      dix: Silence -Wunused-variable warning by moving window.c off of legacy region defines · 0a5d54f7
      Jeremy Huddleston authored
      window.c:223:15: warning: unused variable 'pScreen' [-Wunused-variable,Unused Entity Issue]
          ScreenPtr pScreen = pWin->drawable.pScreen;
                    ^
      Reviewed-by: 's avatarAdam Jackson <ajax@redhat.com>
      Signed-off-by: 's avatarJeremy Huddleston Sequoia <jeremyhu@apple.com>
      0a5d54f7
    • Jeremy Huddleston's avatar
      glx: Fix header length error checking in __glXDisp_RenderLarge · e0987570
      Jeremy Huddleston authored
      glxcmds.c:2206:46: warning: comparison of unsigned expression < 0 is always false [-Wtautological-compare,Semantic Issue]
              if ((cmdlen = safe_pad(hdr->length)) < 0)
                  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ^ ~
      Reviewed-by: 's avatarAdam Jackson <ajax@redhat.com>
      Signed-off-by: 's avatarJeremy Huddleston Sequoia <jeremyhu@apple.com>
      e0987570
    • Jeremy Huddleston's avatar
      randr: Silence -Wshift-negative-value warnings · 5dc41504
      Jeremy Huddleston authored
      rrtransform.c:199:23: warning: shifting a negative signed value is undefined [-Wshift-negative-value,Semantic Issue]
                  rot_cos = F(-1);
                            ^~~~~
      rrtransform.c:114:14: note: expanded from macro 'F'
                      ^~~~~~~~~~~~~~
      ../render/picture.h:200:24: note: expanded from macro 'IntToxFixed'
                              ^~~~~~~~~~~~~~~~~~~~~~
      /opt/X11/include/pixman-1/pixman.h:130:56: note: expanded from macro 'pixman_int_to_fixed'
                                                                 ~~~ ^
      Reviewed-by: 's avatarAdam Jackson <ajax@redhat.com>
      Signed-off-by: 's avatarJeremy Huddleston Sequoia <jeremyhu@apple.com>
      5dc41504
    • Jeremy Huddleston's avatar
      xdmcp: Declare XdmcpFatal _X_NORETURN · 9a2a05a9
      Jeremy Huddleston authored
      xdmcp.c:1404:1: warning: function 'XdmcpFatal' could be declared with attribute 'noreturn'
      [-Wmissing-noreturn,Semantic Issue]
      Signed-off-by: 's avatarJeremy Huddleston Sequoia <jeremyhu@apple.com>
      Reviewed-by: 's avatarAlan Coopersmith <alan.coopersmith@oracle.com>
      9a2a05a9
    • Jeremy Huddleston's avatar
      security: Silence some benign -Wformat warnings · a7a00e4b
      Jeremy Huddleston authored
      XID may be either 'unsigned long' or 'unsigned int' depending on:
      
      typedef unsigned long CARD64;
      typedef unsigned int CARD32;
      typedef unsigned long long CARD64;
      typedef unsigned long CARD32;
      
      typedef unsigned long XID;
      typedef CARD32 XID;
      
      so when building with -Wformat, we get some warnings that are benign.  This silences them.
      
      security.c:215:52: warning: format specifies type 'int' but the argument has type 'XID' (aka 'unsigned long')
            [-Wformat,Format String Issue]
          SecurityAudit("revoked authorization ID %d\n", pAuth->id);
                                                  ~~     ^~~~~~~~~
                                                  %lu
        CC       dpmsstubs.lo
      security.c:553:25: warning: format specifies type 'int' but the argument has type 'XID' (aka 'unsigned long')
            [-Wformat,Format String Issue]
               client->index, pAuth->id, pAuth->trustLevel, pAuth->timeout,
                              ^~~~~~~~~
      security.c:553:55: warning: format specifies type 'int' but the argument has type 'CARD32' (aka 'unsigned long')
            [-Wformat,Format String Issue]
               client->index, pAuth->id, pAuth->trustLevel, pAuth->timeout,
                                                            ^~~~~~~~~~~~~~
      security.c:554:10: warning: format specifies type 'int' but the argument has type 'XID' (aka 'unsigned long')
            [-Wformat,Format String Issue]
               pAuth->group, eventMask);
               ^~~~~~~~~~~~
      security.c:554:24: warning: format specifies type 'int' but the argument has type 'Mask' (aka 'unsigned long')
            [-Wformat,Format String Issue]
               pAuth->group, eventMask);
                             ^~~~~~~~~
      security.c:781:19: warning: format specifies type 'unsigned int' but the argument has type 'Mask' (aka 'unsigned
      long')
            [-Wformat,Format String Issue]
                        requested, rec->id, cid,
                        ^~~~~~~~~
      security.c:781:30: warning: format specifies type 'unsigned int' but the argument has type 'XID' (aka 'unsigned long')
            [-Wformat,Format String Issue]
                        requested, rec->id, cid,
                                   ^~~~~~~
      security.c:863:23: warning: format specifies type 'unsigned int' but the argument has type 'XID' (aka 'unsigned long')
            [-Wformat,Format String Issue]
                            rec->pWin->drawable.id, wClient(rec->pWin)->index,
                            ^~~~~~~~~~~~~~~~~~~~~~
      security.c:893:31: warning: format specifies type 'unsigned int' but the argument has type 'XID' (aka 'unsigned long')
            [-Wformat,Format String Issue]
                                    rec->pWin->drawable.id,
                                    ^~~~~~~~~~~~~~~~~~~~~~
      security.c:915:39: warning: format specifies type 'unsigned int' but the argument has type 'XID' (aka 'unsigned long')
            [-Wformat,Format String Issue]
                        rec->client->index, rec->pWin->drawable.id,
                                            ^~~~~~~~~~~~~~~~~~~~~~
      Signed-off-by: 's avatarJeremy Huddleston Sequoia <jeremyhu@apple.com>
      Reviewed-by: 's avatarAlan Coopersmith <alan.coopersmith@oracle.com>
      a7a00e4b
    • Jeremy Huddleston's avatar
      xres: Silence -Wunused-function warnings when building !COMPOSITE or !RENDER · aa73d587
      Jeremy Huddleston authored
      xres.c:422:1: warning: unused function 'ResFindCompositeClientWindowPixmaps' [-Wunused-function,Unused Entity Issue]
      ResFindCompositeClientWindowPixmaps (void *value, XID id, void *cdata)
      ^
      Signed-off-by: 's avatarJeremy Huddleston Sequoia <jeremyhu@apple.com>
      Reviewed-by: 's avatarAlan Coopersmith <alan.coopersmith@oracle.com>
      aa73d587
    • Jeremy Huddleston's avatar
      xdmauth: Correct miscall of abs() to instrad call labs() · 85eb90ea
      Jeremy Huddleston authored
      xdmauth.c:230:13: warning: absolute value function 'abs' given an argument of type 'long' but has parameter of
      type
      'int'
            which may cause truncation of value [-Wabsolute-value,Semantic Issue]
              if (abs(now - client->time) > TwentyFiveMinutes) {
                  ^
      xdmauth.c:230:13: note: use function 'labs' instead [Semantic Issue]
              if (abs(now - client->time) > TwentyFiveMinutes) {
                  ^~~
                  labs
      xdmauth.c:302:9: warning: absolute value function 'abs' given an argument of type 'long' but has parameter of type
      'int' which
            may cause truncation of value [-Wabsolute-value,Semantic Issue]
          if (abs(client->time - now) > TwentyMinutes) {
              ^
      xdmauth.c:302:9: note: use function 'labs' instead [Semantic Issue]
          if (abs(client->time - now) > TwentyMinutes) {
              ^~~
              labs
      Signed-off-by: 's avatarJeremy Huddleston Sequoia <jeremyhu@apple.com>
      Reviewed-by: 's avatarAlan Coopersmith <alan.coopersmith@oracle.com>
      85eb90ea
    • Jeremy Huddleston's avatar
      randr: Correct a miscall of abs() to instead call fabs() · 9f0fcd14
      Jeremy Huddleston authored
      rrtransform.c:124:22: warning: using integer absolute value function 'abs' when
            argument is of floating point type [-Wabsolute-value,Semantic Issue]
                  if ((v = abs(f_transform->m[j][i])) > max)
                           ^
      rrtransform.c:124:22: note: use function 'fabs' instead [Semantic Issue]
                  if ((v = abs(f_transform->m[j][i])) > max)
                           ^~~
                           fabs
      Signed-off-by: 's avatarJeremy Huddleston Sequoia <jeremyhu@apple.com>
      Reviewed-by: 's avatarAlan Coopersmith <alan.coopersmith@oracle.com>
      9f0fcd14
    • Jeremy Huddleston's avatar
      mi: Correct a miscall of abs() to instead call fabs() · 610dd8a5
      Jeremy Huddleston authored
      miarc.c:1714:9: warning: using integer absolute value function
      'abs' when
            argument is of floating point type [-Wabsolute-value,Semantic Issue]
          if (abs(parc->angle2) >= 360.0)
              ^
      miarc.c:1714:9: note: use function 'fabs' instead [Semantic Issue]
          if (abs(parc->angle2) >= 360.0)
              ^~~
              fabs
      Signed-off-by: 's avatarJeremy Huddleston Sequoia <jeremyhu@apple.com>
      Reviewed-by: 's avatarAlan Coopersmith <alan.coopersmith@oracle.com>
      610dd8a5
  8. 13 Oct, 2015 1 commit
    • Ken Thomases's avatar
      XQuartz: Fix how we calculate the height of the OSX menu bar · 4513f924
      Ken Thomases authored
      +[NSScreen mainScreen] does not mean the primary display.  It used to mean the
      one with the key window.  When "Displays have separate spaces" is enabled, it
      means the active screen, the one whose menu bar is mostly opaque.  As such, it
      may not be the screen whose lower-left corner is located at (0, 0).  That's
      why its max-Y is not necessarily comparable to its height.  That only works
      for the primary display.
      
      This code could use [[NSScreen screens] firstObject].  This is always the
      primary display, the one whose lower-left corner is at (0, 0).
      
      Once that's done, the above change should be reverted.  The height of the
      visible frame would be the full height of the screen minus the menu bar _and
      the Dock_ if the Dock is along the bottom of the screen.
      
      Actually, there's a theoretically-simpler approach: use
      -[NSMenu menuBarHeight].  That replaces a long-deprecated method
      +[NSMenuView menuBarHeight].  However, there was a bug in Tiger that led to
      the former not working while the latter still worked. I haven't actually
      checked recently.
      
      CrossOver's still-kicking X server code uses this code, which tries all of
      the above:
      
             NSScreen* primaryScreen = [[NSScreen screens] objectAtIndex:0];
             aquaMenuBarHeight = [[NSApp mainMenu] menuBarHeight];
             if (!aquaMenuBarHeight) aquaMenuBarHeight = [NSMenuView menuBarHeight];
             if (!aquaMenuBarHeight) aquaMenuBarHeight =
                 NSHeight([primaryScreen frame]) - NSMaxY([primaryScreen visibleFrame]);
      Reviewed-by: 's avatarJeremy Huddleston Sequoia <jeremyhu@apple.com>
      Signed-off-by: 's avatarKen Thomases <ken@codeweavers.com>
      4513f924