Skip to content

Commit

Permalink
system/core: Replace banned strncpy with strlcpy function
Browse files Browse the repository at this point in the history
Replace the usage of strncpy function with a safer
alternative strlcpy

CRs-Fixed: 1064951
Change-Id: I0a4f53c1ad135d1d3bc7fbac2472b6ebcf4f35e0
  • Loading branch information
Devi Sandeep Endluri V V authored and Flinny committed Oct 19, 2016
1 parent ea9507c commit 889019c
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions libnetutils/ifc_utils.c
Original file line number Diff line number Diff line change
Expand Up @@ -173,8 +173,7 @@ void ifc_close6(void)
static void ifc_init_ifr(const char *name, struct ifreq *ifr)
{
memset(ifr, 0, sizeof(struct ifreq));
strncpy(ifr->ifr_name, name, IFNAMSIZ);
ifr->ifr_name[IFNAMSIZ - 1] = 0;
strlcpy(ifr->ifr_name, name, IFNAMSIZ);
}

int ifc_get_hwaddr(const char *name, void *ptr)
Expand Down

0 comments on commit 889019c

Please sign in to comment.