Index: trunk/i386/boot2/boot.c =================================================================== --- trunk/i386/boot2/boot.c (revision 1448) +++ trunk/i386/boot2/boot.c (revision 1449) @@ -499,7 +499,7 @@ void *binary = (void *)kLoadAddr; // additional variable for testing alternate kernel image locations on boot helper partitions. - char bootFile[512]; + char bootFile[sizeof(bootInfo->bootFile)]; char bootFilePath[512]; // Initialize globals. @@ -671,7 +671,7 @@ if (!bootFileWithDevice && (bootInfo->bootFile)[0] != '/') sprintf(bootFile, "/%s", bootInfo->bootFile); // append a leading / else - strcpy(bootFile, bootInfo->bootFile); + strlcpy(bootFile, bootInfo->bootFile, sizeof(bootFile)); // Try to load kernel image from alternate locations on boot helper partitions. ret = -1; @@ -691,7 +691,7 @@ } if (ret == -1) { // No alternate location found, using the original kernel image path. - strcpy(bootFilePath, bootFile); + strlcpy(bootFilePath, bootFile,sizeof(bootFilePath)); } verbose("Loading kernel %s\n", bootFilePath); Index: trunk/i386/boot2/options.c =================================================================== --- trunk/i386/boot2/options.c (revision 1448) +++ trunk/i386/boot2/options.c (revision 1449) @@ -1196,12 +1196,12 @@ gOverrideKernel = false; if (( kernel = extractKernelName((char **)&cp) )) { - strcpy( bootInfo->bootFile, kernel ); + strlcpy( bootInfo->bootFile, kernel, sizeof(bootInfo->bootFile) ); } else { if ( getValueForKey( kKernelNameKey, &val, &cnt, &bootInfo->bootConfig ) ) { strlcpy( bootInfo->bootFile, val, cnt+1 ); } else { - strcpy( bootInfo->bootFile, kDefaultKernel ); + strlcpy( bootInfo->bootFile, kDefaultKernel, sizeof(bootInfo->bootFile) ); } } if (strcmp( bootInfo->bootFile, kDefaultKernel ) != 0) {