ProcRRCreateMode: fix use of uninitialised bytes valgrind error.

==543== Syscall param writev(vector[...]) points to uninitialised byte(s)
==543==    at 0x4AB7154: writev (writev.c:51)
==543==    by 0x8935B: _XSERVTransWritev (Xtrans.c:912)
==543==    by 0x6C55F: FlushClient (io.c:924)
==543==    by 0x6D013: FlushAllOutput (io.c:668)
==543==    by 0x27A83: Dispatch (dispatch.c:453)
==543==    by 0x205B7: main (main.c:291)
==543==  Address 0x556dc8c is 12 bytes inside a block of size 4,096 alloc'd
==543==    at 0x48334A4: calloc (vg_replace_malloc.c:467)
==543==    by 0x6CE37: WriteToClient (io.c:1065)
==543==    by 0x223A7: ProcEstablishConnection (dispatch.c:3685)
==543==    by 0x27B7B: Dispatch (dispatch.c:432)
==543==    by 0x205B7: main (main.c:291)
==543==  Uninitialised value was created by a stack allocation
==543==    at 0xA3350: ProcRRCreateMode (rrmode.c:289)

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Oliver McFadden <oliver.mcfadden@nokia.com>
Signed-off-by: Ander Conselvan de Oliveira <ander.conselvan-de-oliveira@nokia.com>
This commit is contained in:
Ander Conselvan de Oliveira 2011-02-08 11:10:09 +02:00 committed by Peter Hutterer
parent 0ef5973860
commit 87fbef9157

View File

@ -288,7 +288,7 @@ int
ProcRRCreateMode (ClientPtr client) ProcRRCreateMode (ClientPtr client)
{ {
REQUEST(xRRCreateModeReq); REQUEST(xRRCreateModeReq);
xRRCreateModeReply rep; xRRCreateModeReply rep = {0};
WindowPtr pWin; WindowPtr pWin;
ScreenPtr pScreen; ScreenPtr pScreen;
rrScrPrivPtr pScrPriv; rrScrPrivPtr pScrPriv;