1. 19 Dec, 2018 2 commits
    • Ulrich Sibiller's avatar
      fb: Fix memcpy abuse · 020ef045
      Ulrich Sibiller authored
      Fixes ArcticaProject/nx-libs#750
      
      Backport of this commit:
      
      commit e32cc0b4c85c78cd8743a6e1680dcc79054b57ce
      Author: Adam Jackson <ajax@redhat.com>
      Date:   Thu Apr 21 16:37:11 2011 -0400
      
          fb: Fix memcpy abuse
      
          The memcpy fast path implicitly assumes that the copy walks
          left-to-right.  That's not something memcpy guarantees, and newer glibc
          on some processors will indeed break that assumption.  Since we walk a
          line at a time, check the source and destination against the width of
          the blit to determine whether we can be sloppy enough to allow memcpy.
          (Having done this, we can remove the check for !reverse as well.)
      
          On an Intel Core i7-2630QM with an NVIDIA GeForce GTX 460M running in
          NoAccel, the broken code and various fixes for -copywinwin{10,100,500}
          gives (edited to fit in 80 columns):
      
          1: Disable the fastpath entirely
          2: Replace memcpy with memmove
          3: This fix
          4: The code before this fix
      
            1            2                 3                 4           Operation
            ------   ---------------   ---------------   ---------------   ------------
            258000   269000 (  1.04)   544000 (  2.11)   552000 (  2.14)   Copy 10x10
             21300    23000 (  1.08)    43700 (  2.05)    47100 (  2.21)   Copy 100x100
               960      962 (  1.00)     1990 (  2.09)     1990 (  2.07)   Copy 500x500
      
          So it's a modest performance hit, but correctness demands it, and it's
          probably worth keeping the 2x speedup from having the fast path in the
          first place.
      Signed-off-by: 's avatarAdam Jackson <ajax@redhat.com>
      Signed-off-by: 's avatarKeith Packard <keithp@keithp.com>
      020ef045
    • Mike Gabriel's avatar
      8d6a4a9b
  2. 17 Dec, 2018 3 commits
    • Ulrich Sibiller's avatar
      Fix uninitialized bytes · 44c59e12
      Ulrich Sibiller authored
      Fixes this valgrind finding
      
      ==16977== Warning: invalid file descriptor -1 in syscall close()
      ==16977== Conditional jump or move depends on uninitialised value(s)
      ==16977==    at 0x544B6B: XkbSendNewKeyboardNotify (xkbEvents.c:62)
      ==16977==    by 0x540481: ProcXkbGetKbdByName (xkb.c:5330)
      ==16977==    by 0x4341C5: Dispatch (NXdispatch.c:482)
      ==16977==    by 0x40EB02: main (main.c:353)
      ==16977==  Uninitialised value was created by a heap allocation
      ==16977==    at 0x4C2DB8F: malloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
      ==16977==    by 0x431BD7: NextAvailableClient (dispatch.c:3719)
      ==16977==    by 0x47B297: AllocNewConnection (connection.c:821)
      ==16977==    by 0x47B297: EstablishNewConnections (connection.c:910)
      ==16977==    by 0x463DFE: ProcessWorkQueue (dixutils.c:541)
      ==16977==    by 0x47635E: WaitForSomething (WaitFor.c:213)
      ==16977==    by 0x434089: Dispatch (NXdispatch.c:360)
      ==16977==    by 0x40EB02: main (main.c:353)
      44c59e12
    • Ulrich Sibiller's avatar
      xkb: Initialize pad bytes sent in replies of geometry requests. · 5b0bf752
      Ulrich Sibiller authored
      Backport of
      
        commit dc9ce695a69ca0787f58f8d160212a7a41acb703
        Author: Rami Ylimäki <rami.ylimaki@vincit.fi>
        Date:   Wed Mar 9 15:45:40 2011 +0200
      
          xkb: Initialize pad bytes sent in replies of geometry requests.
      
          Valgrind complains about uninitialized data being written to clients.
      Reviewed-by: 's avatarErkki Seppälä <erkki.seppala@vincit.fi>
      Signed-off-by: 's avatarRami Ylimäki <rami.ylimaki@vincit.fi>
      Reviewed-by: 's avatarDaniel Stone <daniel@fooishbar.org>
      Reviewed-by: 's avatarPeter Hutterer <peter.hutterer@who-t.net>
      Signed-off-by: 's avatarPeter Hutterer <peter.hutterer@who-t.net>
      5b0bf752
    • Ulrich Sibiller's avatar
      Fix crash due to uninitialized VModMap fields. · a4fad8f5
      Ulrich Sibiller authored
      Backport of
      
        commit 81b3b0cce088866dc3cda099d7c8d6655849fd43
        Author: Tomas Janousek <tomi@nomi.cz>
        Date:   Wed May 20 15:03:01 2009 +0200
      
          Bug #6428, #16458, #21464: Fix crash due to uninitialized VModMap fields.
      
          In ProcXkbGetKbdByName, mrep.firstVModMapKey, .nVModMapKeys and
          .totalVModMapKeys were not initialized, contained random values and caused
          accesses to unallocated and later modified memory, causing
          XkbSizeVirtualModMap and XkbWriteVirtualModMap to see different number of
          nonzero values, resulting in writes past the end of an array in XkbSendMap.
      
          This patch initializes those values sensibly and reverts commits 5c0a2088 and
          6dd4fc46, which have been plain non-sense.
      Signed-off-by: 's avatarTomas Janousek <tomi@nomi.cz>
      Signed-off-by: 's avatarPeter Hutterer <peter.hutterer@who-t.net>
      a4fad8f5
  3. 22 Nov, 2018 3 commits
  4. 20 Nov, 2018 1 commit
  5. 14 Nov, 2018 3 commits
  6. 11 Nov, 2018 7 commits
  7. 10 Nov, 2018 5 commits
  8. 09 Nov, 2018 16 commits