Skip to content

Commit

Permalink
libteam: ifinfo: fix possible overrun during srtcpy
Browse files Browse the repository at this point in the history
Coverity error:
CID 1031768 (#1 of 1): Copy into fixed size buffer (STRING_OVERFLOW)3. fixed_size_dest: You might overrun the 16 byte fixed-size string "ifinfo->ifname" by copying "ifname" without checking the length.

Signed-off-by: Jiri Pirko <jiri@resnulli.us>
  • Loading branch information
jpirko committed Jun 14, 2013
1 parent 51e001b commit 19966d9
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion libteam/ifinfo.c
Expand Up @@ -95,7 +95,7 @@ static void update_ifname(struct team_ifinfo *ifinfo, struct rtnl_link *link)

ifname = rtnl_link_get_name(link);
if (ifname && strcmp(ifinfo->ifname, ifname)) {
strcpy(ifinfo->ifname, ifname);
mystrlcpy(ifinfo->ifname, ifname, sizeof(ifinfo->ifname));
set_changed(ifinfo, CHANGED_IFNAME);
}
}
Expand Down

0 comments on commit 19966d9

Please sign in to comment.