Chameleon

Chameleon Commit Details

Date:2014-01-07 09:40:31 (10 years 3 months ago)
Author:Chuck Fry
Commit:2315
Parents: 2314
Message:Defend against buffer overruns
Changes:
M/branches/chucko/i386/boot2/ramdisk.c

File differences

branches/chucko/i386/boot2/ramdisk.c
2929
3030
3131
32
32
3333
3434
3535
3636
37
37
3838
3939
4040
4141
42
42
4343
4444
4545
......
151151
152152
153153
154
154
155155
156156
157157
......
182182
183183
184184
185
185
186186
187187
188188
&bootInfo->chameleonConfig))
{
// Use user specified md0 file
sprintf(filename, "%s", override_filename);
snprintf(filename, sizeof(filename), "%s", override_filename);
fh = open(filename, 0);
if(fh < 0)
{
sprintf(filename, "rd(0,0)/Extra/%s", override_filename);
snprintf(filename, sizeof(filename), "rd(0,0)/Extra/%s", override_filename);
fh = open(filename, 0);
if(fh < 0)
{
sprintf(filename, "/Extra/%s", override_filename);
snprintf(filename, sizeof(filename), "/Extra/%s", override_filename);
fh = open(filename, 0);
}
}
if (error == 0)
{
// Save filename in gRAMDiskFile to display information.
strcpy(gRAMDiskFile, param);
strlcpy(gRAMDiskFile, param, sizeof(gRAMDiskFile));
// Set gMI as well for the multiboot ramdisk driver hook.
gMI = gRAMDiskMI = malloc(sizeof(multiboot_info));
char dirSpec[128];
// Reading ramdisk configuration.
strcpy(dirSpec, RAMDISKCONFIG_FILENAME);
strlcpy(dirSpec, RAMDISKCONFIG_FILENAME, sizeof(dirSpec));
if (loadConfigFile(dirSpec, &bootInfo->ramdiskConfig) == 0)
{

Archive Download the corresponding diff file

Revision: 2315