summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRickard Strandqvist <rickard_strandqvist@spectrumdigital.se>2014-08-11 21:18:16 +0200
committerDavid S. Miller <davem@davemloft.net>2014-08-11 14:47:22 -0700
commit8dff81e87d5c2867d7401f8ee7b1eb3e3aa2ba8d (patch)
tree1e33885f93c15ce95e9dc49fce30fce3f7134805
parent97a6d1bb2b658ac85ed88205ccd1ab809899884d (diff)
downloadlinux-8dff81e87d5c2867d7401f8ee7b1eb3e3aa2ba8d.tar.bz2
net: ethernet: myricom: myri10ge: myri10ge.c: Cleaning up missing null-terminate after strncpy call
Added a guaranteed null-terminate after call to strncpy. Signed-off-by: Rickard Strandqvist <rickard_strandqvist@spectrumdigital.se> Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r--drivers/net/ethernet/myricom/myri10ge/myri10ge.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/net/ethernet/myricom/myri10ge/myri10ge.c b/drivers/net/ethernet/myricom/myri10ge/myri10ge.c
index f3d5d79f1cd1..69c26f04d8ce 100644
--- a/drivers/net/ethernet/myricom/myri10ge/myri10ge.c
+++ b/drivers/net/ethernet/myricom/myri10ge/myri10ge.c
@@ -574,6 +574,7 @@ myri10ge_validate_firmware(struct myri10ge_priv *mgp,
/* save firmware version for ethtool */
strncpy(mgp->fw_version, hdr->version, sizeof(mgp->fw_version));
+ mgp->fw_version[sizeof(mgp->fw_version) - 1] = '\0';
sscanf(mgp->fw_version, "%d.%d.%d", &mgp->fw_ver_major,
&mgp->fw_ver_minor, &mgp->fw_ver_tiny);