mirror of https://gitee.com/openkylin/linux.git
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>
This commit is contained in:
parent
97a6d1bb2b
commit
8dff81e87d
|
@ -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);
|
||||
|
|
Loading…
Reference in New Issue