net/ena: improve safety of string handling
authorJohn W. Linville <linville@tuxdriver.com>
Thu, 29 Sep 2016 17:39:33 +0000 (13:39 -0400)
committerBruce Richardson <bruce.richardson@intel.com>
Thu, 13 Oct 2016 13:30:59 +0000 (15:30 +0200)
commit103bb1cc29614a3b4a901d5ef3eef47294b399dc
tree418debf9589d374be6b32abcb84931856d89a9c4
parent8d6c8b9ade221d94622988968ab4a304e37dbab5
net/ena: improve safety of string handling

Use sizeof dest rather than sizeof src for limiting copy length,
and replace strncpy with snprintf to ensure NULL termination.

Coverity issue: 127795
Fixes: 372c1af5ed8f ("net/ena: add dedicated memory area for extra device info")

Signed-off-by: John W. Linville <linville@tuxdriver.com>
Acked-by: Ferruh Yigit <ferruh.yigit@intel.com>
drivers/net/ena/ena_ethdev.c