X-Git-Url: https://git.rohieb.name/openwrt.git/blobdiff_plain/6493ad8f6552952b463465c19a1d7b7376409438..c51009aa07196b8ca6bac39ad47e93b8a5940210:/target/linux/adm5120-2.6/files/drivers/mtd/myloader.c diff --git a/target/linux/adm5120-2.6/files/drivers/mtd/myloader.c b/target/linux/adm5120-2.6/files/drivers/mtd/myloader.c index 1bdd798e4..ee916d780 100644 --- a/target/linux/adm5120-2.6/files/drivers/mtd/myloader.c +++ b/target/linux/adm5120-2.6/files/drivers/mtd/myloader.c @@ -40,7 +40,7 @@ #define NAME_PARTITION_TABLE "Partition Table" #define BLOCK_LEN_MIN 0x10000 -static int parse_myloader_partitions(struct mtd_info *master, +int parse_myloader_partitions(struct mtd_info *master, struct mtd_partition **pparts, unsigned long origin) { @@ -115,14 +115,14 @@ static int parse_myloader_partitions(struct mtd_info *master, mtd_part = mtd_parts; names = (char *)&mtd_parts[num_parts]; - strcpy(NAME_MYLOADER, names); + strncpy(names, NAME_MYLOADER, NAME_LEN_MAX-1); mtd_part->name = names; mtd_part->offset = 0; mtd_part->size = blocklen; mtd_part++; names += NAME_LEN_MAX; - strcpy(NAME_PARTITION_TABLE, names); + strncpy(names, NAME_PARTITION_TABLE, NAME_LEN_MAX-1); mtd_part->name = names; mtd_part->offset = blocklen; mtd_part->size = blocklen; @@ -171,8 +171,6 @@ static void __exit mylo_mtd_parser_exit(void) module_init(mylo_mtd_parser_init); module_exit(mylo_mtd_parser_exit); -EXPORT_SYMBOL_GPL(parse_myloader_partitions); - MODULE_AUTHOR("Gabor Juhos "); MODULE_DESCRIPTION("Parsing code for MyLoader partition tables"); MODULE_LICENSE("GPL");