mirror of
https://github.com/reactos/reactos.git
synced 2025-08-02 13:16:07 +00:00
[VGA_NEW]
- avoid buffer overrun, CID 11049 Brought to light by vicmarcal svn path=/trunk/; revision=50085
This commit is contained in:
parent
4a58e37b7c
commit
90d2da336d
4 changed files with 50 additions and 44 deletions
|
@ -91,7 +91,7 @@ ValidateVbeInfo(IN PHW_DEVICE_EXTENSION VgaExtension,
|
||||||
Context = VgaExtension->Int10Interface.Context;
|
Context = VgaExtension->Int10Interface.Context;
|
||||||
|
|
||||||
/* Check magic and version */
|
/* Check magic and version */
|
||||||
if (strncmp(VbeInfo->Info.Signature, "VESA", 4)) return VesaBiosOk;
|
if (VbeInfo->Info.Signature == VESA_MAGIC) return VesaBiosOk;
|
||||||
if (VbeInfo->Info.Version < 0x102) return VesaBiosOk;
|
if (VbeInfo->Info.Version < 0x102) return VesaBiosOk;
|
||||||
|
|
||||||
/* Read strings */
|
/* Read strings */
|
||||||
|
|
|
@ -94,7 +94,7 @@
|
||||||
|
|
||||||
typedef struct _VBE_CONTROLLER_INFO
|
typedef struct _VBE_CONTROLLER_INFO
|
||||||
{
|
{
|
||||||
CHAR Signature[4];
|
ULONG Signature;
|
||||||
USHORT Version;
|
USHORT Version;
|
||||||
ULONG OemStringPtr;
|
ULONG OemStringPtr;
|
||||||
LONG Capabilities;
|
LONG Capabilities;
|
||||||
|
@ -214,4 +214,7 @@ ValidateVbeInfo(IN PHW_DEVICE_EXTENSION VgaExtension,
|
||||||
|
|
||||||
extern BOOLEAN g_bIntelBrookdaleBIOS;
|
extern BOOLEAN g_bIntelBrookdaleBIOS;
|
||||||
|
|
||||||
|
/* VBE2 magic number */
|
||||||
|
#define VBE2_MAGIC ('V' + ('B' << 8) + ('E' << 16) + ('2' << 24))
|
||||||
|
|
||||||
/* EOF */
|
/* EOF */
|
||||||
|
|
|
@ -209,7 +209,7 @@ InitializeModeTable(IN PHW_DEVICE_EXTENSION VgaExtension)
|
||||||
/* Init VBE data and write to card buffer */
|
/* Init VBE data and write to card buffer */
|
||||||
//VideoPortDebugPrint(0, "have int10 data\n");
|
//VideoPortDebugPrint(0, "have int10 data\n");
|
||||||
VbeInfo->ModeArray[128] = 0xFFFF;
|
VbeInfo->ModeArray[128] = 0xFFFF;
|
||||||
strcpy(VbeInfo->Info.Signature, "VBE2");
|
VbeInfo->Info.Signature = VBE2_MAGIC;
|
||||||
Status = VgaExtension->Int10Interface.Int10WriteMemory(Context,
|
Status = VgaExtension->Int10Interface.Int10WriteMemory(Context,
|
||||||
TrampolineMemorySegment,
|
TrampolineMemorySegment,
|
||||||
TrampolineMemoryOffset,
|
TrampolineMemoryOffset,
|
||||||
|
|
|
@ -443,4 +443,7 @@ extern PVIDEOMODE VgaModeList;
|
||||||
// eVb: 3.5 [END]
|
// eVb: 3.5 [END]
|
||||||
extern VIDEO_ACCESS_RANGE VgaAccessRange[];
|
extern VIDEO_ACCESS_RANGE VgaAccessRange[];
|
||||||
|
|
||||||
|
/* VESA Bios Magic number */
|
||||||
|
#define VESA_MAGIC ('V' + ('E' << 8) + ('S' << 16) + ('A' << 24))
|
||||||
|
|
||||||
#include "vbe.h"
|
#include "vbe.h"
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue