Skip to content

Commit

Permalink
Server/randr.c: Fix potential uninitialized read
Browse files Browse the repository at this point in the history
Zero the temporary rfbScreenInfo struct in vncScreenSetSize() to ensure
that the prefRes member is initialized before calling vncSetModes().
  • Loading branch information
dcommander committed Jan 5, 2025
1 parent 1f68a6b commit 7889512
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions unix/Xvnc/programs/Xserver/hw/vnc/randr.c
Original file line number Diff line number Diff line change
Expand Up @@ -363,6 +363,7 @@ static int vncScreenSetSize(ScreenPtr pScreen, CARD16 width, CARD16 height,
for (j = 0; j < crtc->numOutputs; j++) {
rfbScreenInfo screen;

memset(&screen, 0, sizeof(rfbScreenInfo));
screen.output = crtc->outputs[j];
screen.s.w = min(crtc->mode->mode.width, width - crtc->x);
screen.s.h = min(crtc->mode->mode.height, height - crtc->y);
Expand Down

0 comments on commit 7889512

Please sign in to comment.