Chameleon

Chameleon Commit Details

Date:2014-11-15 03:20:01 (5 years 4 months ago)
Author:ErmaC
Commit:2481
Parents: 2480
Message:Improved defensiveness against malloc failure (disk.c)
Changes:
M/trunk/i386/libsaio/disk.c

File differences

trunk/i386/libsaio/disk.c
765765
766766
767767
768
768
769769
770770
771771
......
10451045
10461046
10471047
1048
1048
10491049
10501050
10511051
......
10711071
10721072
10731073
1074
1074
1075
10751076
10761077
10771078
(*bvr->bv_free)(bvr);
bvr = NULL;
}
if ( readBootSector( biosdev, blkoff, (void *)0x7e00 ) == 0 )
else if ( readBootSector( biosdev, blkoff, (void *)0x7e00 ) == 0 )
{
bvr->flags |= kBVFlagBootable;
}
* an Apple partition map elsewhere.
*/
#if UNUSED
if (map->bvrcnt == 0)
if (map && map->bvrcnt == 0)
{
static struct fdisk_part cdpart;
cdpart.systid = 0xCD;
}
#endif
// Actually this should always be true given the above code
if(map == gDiskBVMap)
// (unless malloc failed above)
if(map && map == gDiskBVMap)
{
// Don't leave a null map in the chain
if(map->bvrcnt == 0 && map->bvr == NULL)

Archive Download the corresponding diff file

Revision: 2481