• Ulrich Sibiller's avatar
    os/io.c: fix unitialised bytes · e5975a70
    Ulrich Sibiller authored
    ... by implementing some kind of recalloc (mix of realloc and calloc).
    
    Fixes this valgrind finding:
    
    ==7061== Syscall param writev(vector[...]) points to uninitialised byte(s)
    ==7061==    at 0x781EFE0: __writev_nocancel (syscall-template.S:84)
    ==7061==    by 0x488974: _XSERVTransSocketWritev (Xtranssock.c:2914)
    ==7061==    by 0x47DBD3: FlushClient (io.c:1080)
    ==7061==    by 0x47DBD3: FlushAllOutput.part.0 (io.c:817)
    ==7061==    by 0x477304: WaitForSomething (WaitFor.c:246)
    ==7061==    by 0x434369: Dispatch (NXdispatch.c:360)
    ==7061==    by 0x40EB92: main (main.c:353)
    ==7061==  Address 0x102106f3 is 50,211 bytes inside a block of size 54,308 alloc'd
    ==7061==    at 0x4C2FD5F: realloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
    ==7061==    by 0x47F08F: FlushClient (io.c:1123)
    ==7061==    by 0x47F307: WriteToClient (io.c:991)
    ==7061==    by 0x42903C: doListFontsAndAliases (NXdixfonts.c:660)
    ==7061==    by 0x42B7D6: ListFonts (NXdixfonts.c:735)
    ==7061==    by 0x433A6D: ProcListFonts (NXdispatch.c:989)
    ==7061==    by 0x4344A5: Dispatch (NXdispatch.c:482)
    ==7061==    by 0x40EB92: main (main.c:353)
    ==7061==  Uninitialised value was created by a heap allocation
    ==7061==    at 0x4C2FD5F: realloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
    ==7061==    by 0x47F08F: FlushClient (io.c:1123)
    ==7061==    by 0x47F307: WriteToClient (io.c:991)
    ==7061==    by 0x42903C: doListFontsAndAliases (NXdixfonts.c:660)
    ==7061==    by 0x42B7D6: ListFonts (NXdixfonts.c:735)
    ==7061==    by 0x433A6D: ProcListFonts (NXdispatch.c:989)
    ==7061==    by 0x4344A5: Dispatch (NXdispatch.c:482)
    ==7061==    by 0x40EB92: main (main.c:353)
    ==7061==
    e5975a70
Name
Last commit
Last update
..
GL Loading commit data...
Xext Loading commit data...
Xi Loading commit data...
composite Loading commit data...
damageext Loading commit data...
dbe Loading commit data...
dix Loading commit data...
fb Loading commit data...
hw/nxagent Loading commit data...
include Loading commit data...
mi Loading commit data...
miext Loading commit data...
os Loading commit data...
randr Loading commit data...
record Loading commit data...
render Loading commit data...
xfixes Loading commit data...
xkb Loading commit data...
.gitignore Loading commit data...
Imakefile Loading commit data...
fix-miregion Loading commit data...
fix-miregion-private Loading commit data...
fix-region Loading commit data...