You've already forked hardkernel-uboot
mirror of
https://github.com/archr-linux/hardkernel-uboot.git
synced 2026-03-31 15:05:07 -07:00
Fix GCC format-security errors and convert sprintfs.
With format-security errors turned on, GCC picks up the use of sprintf with a format parameter not being a string literal. Simple uses of sprintf are also converted to use strcpy. Signed-off-by: Ben Whitten <ben.whitten@gmail.com> Acked-by: Wolfgang Denk <wd@denx.de> Reviewed-by: Tom Rini <trini@konsulko.com>
This commit is contained in:
@@ -279,7 +279,7 @@ int au1x00_enet_initialize(bd_t *bis){
|
||||
|
||||
memset(dev, 0, sizeof *dev);
|
||||
|
||||
sprintf(dev->name, "Au1X00 ethernet");
|
||||
strcpy(dev->name, "Au1X00 ethernet");
|
||||
dev->iobase = 0;
|
||||
dev->priv = 0;
|
||||
dev->init = au1x00_init;
|
||||
|
||||
@@ -355,7 +355,7 @@ int mpc82xx_scc_enet_initialize(bd_t *bis)
|
||||
dev = (struct eth_device *) malloc(sizeof *dev);
|
||||
memset(dev, 0, sizeof *dev);
|
||||
|
||||
sprintf(dev->name, "SCC");
|
||||
strcpy(dev->name, "SCC");
|
||||
dev->init = sec_init;
|
||||
dev->halt = sec_halt;
|
||||
dev->send = sec_send;
|
||||
|
||||
@@ -148,7 +148,7 @@ int fec_initialize(bd_t *bis)
|
||||
/* for FEC1 make sure that the name of the interface is the same
|
||||
as the old one for compatibility reasons */
|
||||
if (i == 0) {
|
||||
sprintf (dev->name, "FEC");
|
||||
strcpy(dev->name, "FEC");
|
||||
} else {
|
||||
sprintf (dev->name, "FEC%d",
|
||||
ether_fcc_info[i].ether_index + 1);
|
||||
|
||||
@@ -77,7 +77,7 @@ int scc_initialize(bd_t *bis)
|
||||
dev = (struct eth_device*) malloc(sizeof *dev);
|
||||
memset(dev, 0, sizeof *dev);
|
||||
|
||||
sprintf(dev->name, "SCC");
|
||||
strcpy(dev->name, "SCC");
|
||||
dev->iobase = 0;
|
||||
dev->priv = 0;
|
||||
dev->init = scc_init;
|
||||
|
||||
@@ -981,11 +981,11 @@ static void *video_logo (void)
|
||||
U_BOOT_VERSION, U_BOOT_DATE, U_BOOT_TIME);
|
||||
video_drawstring (VIDEO_INFO_X, VIDEO_INFO_Y, info);
|
||||
|
||||
sprintf (info, "(C) 2002 DENX Software Engineering");
|
||||
strcpy(info, "(C) 2002 DENX Software Engineering");
|
||||
video_drawstring (VIDEO_INFO_X, VIDEO_INFO_Y + VIDEO_FONT_HEIGHT,
|
||||
info);
|
||||
|
||||
sprintf (info, " Wolfgang DENK, wd@denx.de");
|
||||
strcpy(info, " Wolfgang DENK, wd@denx.de");
|
||||
video_drawstring (VIDEO_INFO_X, VIDEO_INFO_Y + VIDEO_FONT_HEIGHT * 2,
|
||||
info);
|
||||
|
||||
|
||||
@@ -408,22 +408,22 @@ void board_ft_fman_fixup_port(void *fdt, char *compat, phys_addr_t addr,
|
||||
sizeof(f_link));
|
||||
break;
|
||||
case 0x98: /* XAUI interface */
|
||||
sprintf(alias, "phy_xaui_slot1");
|
||||
strcpy(alias, "phy_xaui_slot1");
|
||||
fdt_status_okay_by_alias(fdt, alias);
|
||||
|
||||
sprintf(alias, "phy_xaui_slot2");
|
||||
strcpy(alias, "phy_xaui_slot2");
|
||||
fdt_status_okay_by_alias(fdt, alias);
|
||||
break;
|
||||
case 0x9e: /* XAUI interface */
|
||||
case 0x9a:
|
||||
case 0x93:
|
||||
case 0x91:
|
||||
sprintf(alias, "phy_xaui_slot1");
|
||||
strcpy(alias, "phy_xaui_slot1");
|
||||
fdt_status_okay_by_alias(fdt, alias);
|
||||
break;
|
||||
case 0x97: /* XAUI interface */
|
||||
case 0xc3:
|
||||
sprintf(alias, "phy_xaui_slot2");
|
||||
strcpy(alias, "phy_xaui_slot2");
|
||||
fdt_status_okay_by_alias(fdt, alias);
|
||||
break;
|
||||
default:
|
||||
|
||||
@@ -170,7 +170,7 @@ static int hydra_mdio_init(char *realbusname, char *fakebusname)
|
||||
bus->read = hydra_mdio_read;
|
||||
bus->write = hydra_mdio_write;
|
||||
bus->reset = hydra_mdio_reset;
|
||||
sprintf(bus->name, fakebusname);
|
||||
strcpy(bus->name, fakebusname);
|
||||
|
||||
hmdio->realbus = miiphy_get_dev_by_name(realbusname);
|
||||
|
||||
|
||||
@@ -175,7 +175,7 @@ static int super_hydra_mdio_init(char *realbusname, char *fakebusname)
|
||||
bus->read = super_hydra_mdio_read;
|
||||
bus->write = super_hydra_mdio_write;
|
||||
bus->reset = super_hydra_mdio_reset;
|
||||
sprintf(bus->name, fakebusname);
|
||||
strcpy(bus->name, fakebusname);
|
||||
|
||||
hmdio->realbus = miiphy_get_dev_by_name(realbusname);
|
||||
|
||||
|
||||
@@ -113,7 +113,7 @@ static int ls1021a_mdio_init(char *realbusname, char *fakebusname)
|
||||
bus->read = ls1021a_mdio_read;
|
||||
bus->write = ls1021a_mdio_write;
|
||||
bus->reset = ls1021a_mdio_reset;
|
||||
sprintf(bus->name, fakebusname);
|
||||
strcpy(bus->name, fakebusname);
|
||||
|
||||
lsmdio->realbus = miiphy_get_dev_by_name(realbusname);
|
||||
|
||||
|
||||
@@ -136,7 +136,7 @@ static int ls1043aqds_mdio_init(char *realbusname, u8 muxval)
|
||||
bus->read = ls1043aqds_mdio_read;
|
||||
bus->write = ls1043aqds_mdio_write;
|
||||
bus->reset = ls1043aqds_mdio_reset;
|
||||
sprintf(bus->name, ls1043aqds_mdio_name_for_muxval(muxval));
|
||||
strcpy(bus->name, ls1043aqds_mdio_name_for_muxval(muxval));
|
||||
|
||||
pmdio->realbus = miiphy_get_dev_by_name(realbusname);
|
||||
|
||||
|
||||
@@ -412,7 +412,7 @@ static int ls2080a_qds_mdio_init(char *realbusname, u8 muxval)
|
||||
bus->read = ls2080a_qds_mdio_read;
|
||||
bus->write = ls2080a_qds_mdio_write;
|
||||
bus->reset = ls2080a_qds_mdio_reset;
|
||||
sprintf(bus->name, ls2080a_qds_mdio_name_for_muxval(muxval));
|
||||
strcpy(bus->name, ls2080a_qds_mdio_name_for_muxval(muxval));
|
||||
|
||||
pmdio->realbus = miiphy_get_dev_by_name(realbusname);
|
||||
|
||||
|
||||
@@ -148,7 +148,7 @@ static int t1024qds_mdio_init(char *realbusname, u8 muxval)
|
||||
bus->read = t1024qds_mdio_read;
|
||||
bus->write = t1024qds_mdio_write;
|
||||
bus->reset = t1024qds_mdio_reset;
|
||||
sprintf(bus->name, t1024qds_mdio_name_for_muxval(muxval));
|
||||
strcpy(bus->name, t1024qds_mdio_name_for_muxval(muxval));
|
||||
|
||||
pmdio->realbus = miiphy_get_dev_by_name(realbusname);
|
||||
|
||||
|
||||
@@ -162,7 +162,7 @@ static int t1040_qds_mdio_init(char *realbusname, u8 muxval)
|
||||
bus->read = t1040_qds_mdio_read;
|
||||
bus->write = t1040_qds_mdio_write;
|
||||
bus->reset = t1040_qds_mdio_reset;
|
||||
sprintf(bus->name, t1040_qds_mdio_name_for_muxval(muxval));
|
||||
strcpy(bus->name, t1040_qds_mdio_name_for_muxval(muxval));
|
||||
|
||||
pmdio->realbus = miiphy_get_dev_by_name(realbusname);
|
||||
|
||||
|
||||
@@ -176,7 +176,7 @@ static int t208xqds_mdio_init(char *realbusname, u8 muxval)
|
||||
bus->read = t208xqds_mdio_read;
|
||||
bus->write = t208xqds_mdio_write;
|
||||
bus->reset = t208xqds_mdio_reset;
|
||||
sprintf(bus->name, t208xqds_mdio_name_for_muxval(muxval));
|
||||
strcpy(bus->name, t208xqds_mdio_name_for_muxval(muxval));
|
||||
|
||||
pmdio->realbus = miiphy_get_dev_by_name(realbusname);
|
||||
|
||||
|
||||
@@ -153,7 +153,7 @@ static int t4240qds_mdio_init(char *realbusname, u8 muxval)
|
||||
bus->read = t4240qds_mdio_read;
|
||||
bus->write = t4240qds_mdio_write;
|
||||
bus->reset = t4240qds_mdio_reset;
|
||||
sprintf(bus->name, t4240qds_mdio_name_for_muxval(muxval));
|
||||
strcpy(bus->name, t4240qds_mdio_name_for_muxval(muxval));
|
||||
|
||||
pmdio->realbus = miiphy_get_dev_by_name(realbusname);
|
||||
|
||||
|
||||
@@ -80,7 +80,7 @@ int ihs_mdio_init(struct ihs_mdio_info *info)
|
||||
bus->read = ihs_mdio_read;
|
||||
bus->write = ihs_mdio_write;
|
||||
bus->reset = ihs_mdio_reset;
|
||||
sprintf(bus->name, info->name);
|
||||
strcpy(bus->name, info->name);
|
||||
|
||||
bus->priv = info;
|
||||
|
||||
|
||||
@@ -168,7 +168,7 @@ static int do_setboardid(cmd_tbl_t *cmdtp, int flag, int argc,
|
||||
printf("can't get the IVM_Boardid\n");
|
||||
return 1;
|
||||
}
|
||||
sprintf((char *)buf, "%s", p);
|
||||
strcpy((char *)buf, p);
|
||||
setenv("boardid", (char *)buf);
|
||||
printf("set boardid=%s\n", buf);
|
||||
|
||||
@@ -177,7 +177,7 @@ static int do_setboardid(cmd_tbl_t *cmdtp, int flag, int argc,
|
||||
printf("can't get the IVM_HWKey\n");
|
||||
return 1;
|
||||
}
|
||||
sprintf((char *)buf, "%s", p);
|
||||
strcpy((char *)buf, p);
|
||||
setenv("hwkey", (char *)buf);
|
||||
printf("set hwkey=%s\n", buf);
|
||||
printf("Execute manually saveenv for persistent storage.\n");
|
||||
|
||||
@@ -698,12 +698,12 @@ void video_get_info_str (int line_number, char *info)
|
||||
s=getenv ("serial#");
|
||||
#ifdef CONFIG_PIP405
|
||||
if (!s || strncmp (s, "PIP405", 6)) {
|
||||
sprintf(buf,"### No HW ID - assuming PIP405");
|
||||
strcpy(buf,"### No HW ID - assuming PIP405");
|
||||
}
|
||||
#endif
|
||||
#ifdef CONFIG_MIP405
|
||||
if (!s || strncmp (s, "MIP405", 6)) {
|
||||
sprintf(buf,"### No HW ID - assuming MIP405");
|
||||
strcpy(buf,"### No HW ID - assuming MIP405");
|
||||
}
|
||||
#endif
|
||||
else {
|
||||
@@ -718,7 +718,7 @@ void video_get_info_str (int line_number, char *info)
|
||||
}
|
||||
buf[i++] = *s;
|
||||
}
|
||||
sprintf(&buf[i]," SN ");
|
||||
strcpy(&buf[i]," SN ");
|
||||
i+=4;
|
||||
for (; s < e; ++s) {
|
||||
buf[i++] = *s;
|
||||
@@ -744,7 +744,7 @@ void video_get_info_str (int line_number, char *info)
|
||||
ctfb.modeIdent);
|
||||
return;
|
||||
case 1:
|
||||
sprintf (buf, "%s",CONFIG_IDENT_STRING);
|
||||
strcpy(buf, CONFIG_IDENT_STRING);
|
||||
sprintf (info, " %s", &buf[1]);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -355,10 +355,10 @@ int exynos_init(void)
|
||||
}
|
||||
|
||||
/* Request soft I2C gpios */
|
||||
sprintf(buf, "soft_i2c_scl");
|
||||
strcpy(buf, "soft_i2c_scl");
|
||||
gpio_request(CONFIG_SOFT_I2C_GPIO_SCL, buf);
|
||||
|
||||
sprintf(buf, "soft_i2c_sda");
|
||||
strcpy(buf, "soft_i2c_sda");
|
||||
gpio_request(CONFIG_SOFT_I2C_GPIO_SDA, buf);
|
||||
|
||||
check_hw_revision();
|
||||
|
||||
@@ -480,7 +480,7 @@ int board_late_init(void)
|
||||
sprintf(tmp, "%s_%s", factory_dat.asn,
|
||||
factory_dat.comp_version);
|
||||
else
|
||||
sprintf(tmp, "QMX7.E38_4.0");
|
||||
strcpy(tmp, "QMX7.E38_4.0");
|
||||
|
||||
ret = setenv("boardid", tmp);
|
||||
if (ret)
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user