Chameleon

Chameleon Commit Details

Date:2014-01-07 09:29:23 (10 years 3 months ago)
Author:Chuck Fry
Commit:2305
Parents: 2304
Message:Fix cppcheck detected memory leak, make more robust against buffer overrun
Changes:
M/branches/chucko/i386/libsaio/pci_root.c

File differences

branches/chucko/i386/libsaio/pci_root.c
7979
8080
8181
82
82
8383
8484
8585
......
9898
9999
100100
101
101
102102
103103
104104
105105
106106
107107
108
108109
109110
110111
// Try using the file specified with the DSDT option
if (getValueForKey(kDSDT, &dsdt_filename, &len, &bootInfo->chameleonConfig))
{
sprintf(dsdt_dirSpec, dsdt_filename);
snprintf(dsdt_dirSpec, sizeof(dsdt_dirSpec), dsdt_filename);
}
else
{
fsize = file_size(fd);
if ((new_dsdt = malloc(fsize)) == NULL) {
if (!(new_dsdt = malloc(fsize))) {
verbose("[ERROR] alloc DSDT memory failed\n");
close (fd);
goto out;
}
if (read (fd, new_dsdt, fsize) != fsize) {
verbose("[ERROR] read %s failed\n", dsdt_filename);
free(new_dsdt);
close (fd);
goto out;
}

Archive Download the corresponding diff file

Revision: 2305