Chameleon

Chameleon Commit Details

Date:2011-05-21 16:21:31 (12 years 10 months ago)
Author:Kabyl
Commit:863
Parents: 862
Message:Fixed bug where the field's offset of an SMBIOS record is bigger than the length of the actual record
Changes:
M/trunk/i386/libsaio/smbios.c

File differences

trunk/i386/libsaio/smbios.c
148148
149149
150150
151
152
151
152
153153
154154
155155
......
193193
194194
195195
196
196
197197
198
198
199199
200
200
201201
202
202
203203
204204
205205
......
335335
336336
337337
338
338
339339
340340
341341
......
606606
607607
608608
609
610
609611
610612
611613
......
636638
637639
638640
639
641
640642
641643
642644
......
791793
792794
793795
794
796
795797
796
798
797799
798800
799801
char**defaultValue;
} SMBValueSetter;
SMBValueSetter SMBSetters[] =
{
SMBValueSetter SMBSetters[] =
{
//-------------------------------------------------------------------------------------------------------------------------
// BIOSInformation
//-------------------------------------------------------------------------------------------------------------------------
{kSMBTypeBaseBoard,kSMBString,getFieldOffset(SMBBaseBoard, product),kSMBBaseBoardProductKey,
NULL,&defaultBaseBoard.product},
{kSMBTypeBaseBoard,kSMBString,getFieldOffset(SMBBaseBoard, version),NULL,NULL,NULL},
{kSMBTypeBaseBoard,kSMBString,getFieldOffset(SMBBaseBoard, version),NULL,NULL,NULL},
{kSMBTypeBaseBoard,kSMBString,getFieldOffset(SMBBaseBoard, serialNumber),NULL,NULL,NULL},
{kSMBTypeBaseBoard,kSMBString,getFieldOffset(SMBBaseBoard, serialNumber),NULL,NULL,NULL},
{kSMBTypeBaseBoard,kSMBString,getFieldOffset(SMBBaseBoard, assetTagNumber),NULL,NULL,NULL},
{kSMBTypeBaseBoard,kSMBString,getFieldOffset(SMBBaseBoard, assetTagNumber),NULL,NULL,NULL},
{kSMBTypeBaseBoard,kSMBString,getFieldOffset(SMBBaseBoard, locationInChassis),NULL,NULL,NULL},
{kSMBTypeBaseBoard,kSMBString,getFieldOffset(SMBBaseBoard, locationInChassis),NULL,NULL,NULL},
//-------------------------------------------------------------------------------------------------------------------------
break;
case CPU_MODEL_SANDY:
case CPU_MODEL_SANDY_XEON:
case CPU_MODEL_SANDY_XEON:
defaultBIOSInfo.version= kDefaultiMacSandyBIOSVersion;
defaultSystemInfo.productName= kDefaultiMacSandy;
defaultSystemInfo.family= kDefaultiMacFamily;
for (i = 0; i < numOfSetters; i++)
if (structPtr->orig->type == SMBSetters[i].type)
{
if (SMBSetters[i].fieldOffset > structPtr->orig->length)
continue;
setterFound = true;
setSMBValue(structPtr, i, (returnType *)((uint8_t *)structPtr->new + SMBSetters[i].fieldOffset));
}
tableLength += structSize;
if (structSize > maxStructSize)
if (structSize > maxStructSize)
maxStructSize = structSize;
structureCount++;
case kSMBTypeMemoryDevice:
Platform.DMI.CntMemorySlots++;
if (((SMBMemoryDevice *)structHeader)->memorySize != 0)
if (((SMBMemoryDevice *)structHeader)->memorySize != 0)
Platform.DMI.MemoryModules++;
if (((SMBMemoryDevice *)structHeader)->memorySpeed > 0)
if (((SMBMemoryDevice *)structHeader)->memorySpeed > 0)
Platform.RAM.DIMM[dimmnbr].Frequency = ((SMBMemoryDevice *)structHeader)->memorySpeed;
dimmnbr++;
break;

Archive Download the corresponding diff file

Revision: 863