Skip to content

Fix uninitialized read in MGAEnableSecondOutPut

Raphael Isemann requested to merge teemperor/xf86-video-mga:FixUninitRead into master

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.

Merge request reports