Merge "ipq40xx: Replace strcpy with strlcpy"

This commit is contained in:
Linux Build Service Account 2018-03-08 08:06:02 -08:00 committed by Gerrit - the friendly Code Review server
commit ed7b3de7eb
2 changed files with 3 additions and 2 deletions

View file

@ -136,7 +136,8 @@ static void setup_commandline_tag(bd_t *bd, char *commandline)
params->hdr.size =
(sizeof (struct tag_header) + strlen (p) + 1 + 4) >> 2;
strcpy (params->u.cmdline.cmdline, p);
strlcpy (params->u.cmdline.cmdline, p,
sizeof(params->u.cmdline.cmdline));
params = tag_next (params);
}

View file

@ -849,7 +849,7 @@ int ipq_gmac_init(ipq_gmac_board_cfg_t *gmac_cfg)
ipq_gmac_mii_clk_init(ipq_gmac_macs[i], clk_div_val, gmac_cfg);
strncpy((char *)ipq_gmac_macs[i]->phy_name, gmac_cfg->phy_name,
strlcpy((char *)ipq_gmac_macs[i]->phy_name, gmac_cfg->phy_name,
sizeof(ipq_gmac_macs[i]->phy_name));
bb_nodes[i] = malloc(sizeof(struct bitbang_nodes));
if (bb_nodes[i] == NULL)