Chameleon

Chameleon Commit Details

Date:2015-03-11 15:24:01 (4 years 4 months ago)
Author:ErmaC
Commit:2612
Parents: 2611
Message:strncmp instead of strcmp
Changes:
M/trunk/i386/modules/Keylayout/Keylayout.c
M/trunk/i386/libsaio/disk.c
M/trunk/i386/libsaio/device_tree.c
M/trunk/i386/libsaio/load.c
M/trunk/i386/libsaio/convert.c

File differences

trunk/i386/libsaio/device_tree.c
379379
380380
381381
382
382
383383
384384
385385
......
497497
498498
499499
500
500
501501
502502
503503
for (prop = node->properties; prop; prop = prop->next)
{
//DPRINTF("Prop '%s'\n", prop->name);
if (strcmp(prop->name, "name") == 0)
if (strncmp(prop->name, "name", sizeof("name")) == 0)
{
return prop->value;
}
for (prop = node->properties; prop; prop = prop->next)
{
char c = *((char *)prop->value);
if (prop->length < 64 && (strcmp(prop->name, "name") == 0 || (c >= '0' && c <= '9') || (c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z') || c == '_'))
if (prop->length < 64 && (strncmp(prop->name, "name", sizeof("name") ) == 0 || (c >= '0' && c <= '9') || (c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z') || c == '_'))
{
printf("%s Property '%s' [%d] = '%s'\n", spaces, prop->name, prop->length, prop->value);
}
trunk/i386/libsaio/load.c
301301
302302
303303
304
304
305305
306306
307307
stop("Kernel overflows available space");
}
if (vmsize && ((strcmp(segname, "__PRELINK_INFO") == 0) || (strcmp(segname, "__PRELINK") == 0)))
if (vmsize && ((strncmp(segname, "__PRELINK_INFO", sizeof("__PRELINK_INFO")) == 0) || (strncmp(segname, "__PRELINK", sizeof("__PRELINK")) == 0)))
{
gHaveKernelCache = true;
}
trunk/i386/libsaio/disk.c
13311331
13321332
13331333
1334
1334
13351335
13361336
13371337
dpme.dpme_boot_block);
*/
if (strcmp(dpme_p->dpme_type, "Apple_HFS") == 0)
if (strncmp(dpme_p->dpme_type, "Apple_HFS", sizeof("Apple_HFS")) == 0)
{
bvr = newAPMBVRef(biosdev,
i,
trunk/i386/libsaio/convert.c
1313
1414
1515
16
16
1717
1818
1919
static char msg[UUID_LEN*2 + 8] = "";
if (!eUUID) return "";
const unsigned char * uuid = (unsigned char*) eUUID;
sprintf(msg, "%02x%02x%02x%02x-%02x%02x-%02x%02x-%02x%02x-%02x%02x%02x%02x%02x%02x",
snprintf(msg, sizeof(msg), "%02x%02x%02x%02x-%02x%02x-%02x%02x-%02x%02x-%02x%02x%02x%02x%02x%02x",
uuid[0], uuid[1], uuid[2], uuid[3],
uuid[4], uuid[5], uuid[6], uuid[7],
uuid[8], uuid[9], uuid[10],uuid[11],
trunk/i386/modules/Keylayout/Keylayout.c
140140
141141
142142
143
143
144144
145145
146146
{
snprintf(layoutPath, sizeof(layoutPath),"/Extra/Keymaps/%s", val);
// Add the extension if needed
if (len <= 4 || strcmp(val+len-4,".lyt") != 0)
if (len <= 4 || strncmp(val+len-4,".lyt", sizeof(".lyt")) != 0)
strncat(layoutPath, ".lyt", sizeof(layoutPath) - strlen(layoutPath) - 1);
if (!load_keyboard_layout_file(layoutPath))

Archive Download the corresponding diff file

Revision: 2612