aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJiri Pirko <jiri@resnulli.us>2014-08-19 08:54:24 +0200
committerJiri Pirko <jiri@resnulli.us>2014-08-19 08:56:14 +0200
commit34080bd1f3534467b1a8fc5c2a36c82170a75ffd (patch)
treeecc853e3be748a6df49bbeecb48af450abc10be2
parent332dc54e8f59a9ca794bb3a90791af084fa44f74 (diff)
downloadlibteam-34080bd1f3534467b1a8fc5c2a36c82170a75ffd.tar.gz
teamd: fix coverity error in teamd_sriov_physfn_addr
Passing variable "256UL" as argument 3 to function readlink, which returns that argument. The value of "ret" is now 256. Overrunning array "link" of 256 bytes at byte offset 256 using index "ret" (which evaluates to 256). Signed-off-by: Jiri Pirko <jiri@resnulli.us>
-rw-r--r--teamd/teamd_phys_port_check.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/teamd/teamd_phys_port_check.c b/teamd/teamd_phys_port_check.c
index e47fb48..6e3c56c 100644
--- a/teamd/teamd_phys_port_check.c
+++ b/teamd/teamd_phys_port_check.c
@@ -43,7 +43,7 @@ static int teamd_sriov_physfn_addr(struct pcie_addr *addr, const char *ifname)
if (ret == -1)
return -ENOMEM;
- ret = readlink(path, link, sizeof(link));
+ ret = readlink(path, link, sizeof(link) - 1);
free(path);
if (ret == -1)
return -errno;