diff options
author | Raphael Isemann <teemperor@gmail.com> | 2022-04-13 12:14:46 +0200 |
---|---|---|
committer | Raphael Isemann <teemperor@gmail.com> | 2022-04-13 13:12:29 +0200 |
commit | 638653561df767b052e372821ffd51c457591202 (patch) | |
tree | c9fbf01fe9783a2fbb827e320d9910e301c8bc80 /src | |
parent | a6ab1e08ee8c5a6dfaebe8fc331bd0811ab8d13f (diff) |
Fix uninitialized read in MGAEnableSecondOutPut
`MGAGRestore` allocated `ModeInfo` without initializing its memory and then
passes it into `MGAEnableSecondOutPut` via `MGAEnableSecondOutPut(pScrn, &ModeInfo);`.
`MGAEnableSecondOutPut` then reads the unitialized memory in the line
`if ( !(pModeInfo->flSignalMode & POS_HSYNC) )`.
This patch just zeroes the memory to prevent those branches to be randomly
taken.
Signed-off-by: Raphael Isemann <teemperor@gmail.com>
Diffstat (limited to 'src')
-rw-r--r-- | src/mga_dacG.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/src/mga_dacG.c b/src/mga_dacG.c index f9858ca..ce0f0aa 100644 --- a/src/mga_dacG.c +++ b/src/mga_dacG.c @@ -1754,6 +1754,7 @@ MGA_NOT_HAL( } else { /* Second Crtc */ xMODEINFO ModeInfo; + memset( &ModeInfo, 0, sizeof(ModeInfo) ); MGA_NOT_HAL( /* Enable Dual Head */ |