Chameleon

Chameleon Commit Details

Date:2014-01-07 09:25:54 (7 years 1 month ago)
Author:Chuck Fry
Commit:2303
Parents: 2302
Message:Fix memory leak; use snprintf instead of sprintf to make more robust
Changes:
M/branches/chucko/i386/libsaio/nvidia.c

File differences

branches/chucko/i386/libsaio/nvidia.c
16991699
17001700
17011701
1702
1703
1704
1705
1702
1703
1704
17061705
17071706
17081707
......
20642063
20652064
20662065
2067
2066
20682067
20692068
20702069
......
21692168
21702169
21712170
2171
21722172
21732173
21742174
{
if (nvidia_card_vendors[j].device == (subsys_id & 0xffff0000))
{
sprintf(name_model, "%s %s",
nvidia_card_vendors[j].name, nvidia_card_generic[i].name);
name_model[sizeof(name_model) - 1] = '\0';
return name_model;
snprintf(name_model, sizeof(name_model), "%s %s",
nvidia_card_vendors[j].name, nvidia_card_generic[i].name);
return name_model;
}
}
}
}
}
sprintf(biosVersion, "%s", (nvBiosOveride > 0) ? nvFilename : version_str);
snprintf(biosVersion, sizeof(biosVersion), "%s", (nvBiosOveride > 0) ? nvFilename : version_str);
sprintf(kNVCAP, "NVCAP_%04x", nvda_dev->device_id);
if (getValueForKey(kNVCAP, &value, &len, &bootInfo->chameleonConfig) && len == NVCAP_LEN * 2)
memcpy(stringdata, (uint8_t*)devprop_generate_string(string), string->length);
stringlength = string->length;
free(version_str);
free(rom);
return true;
}

Archive Download the corresponding diff file

Revision: 2303