[Intel-wired-lan] [next S97 v2 3/6] i40e: Replace strncpy with strlcpy to ensure null termination

Bowers, AndrewX andrewx.bowers at intel.com
Wed Oct 31 19:15:59 UTC 2018


> -----Original Message-----
> From: Intel-wired-lan [mailto:intel-wired-lan-bounces at osuosl.org] On
> Behalf Of Jeff Kirsher
> Sent: Tuesday, October 30, 2018 10:51 AM
> To: intel-wired-lan at lists.osuosl.org
> Cc: Patryk Małek <patryk.malek at intel.com>
> Subject: [Intel-wired-lan] [next S97 v2 3/6] i40e: Replace strncpy with strlcpy
> to ensure null termination
> 
> From: Patryk Małek <patryk.malek at intel.com>
> 
> Using strncpy allows destination buffer to be not null terminated after the
> copying takes place. strlcpy ensures that's not the case by explicitly setting
> last element in the buffer as '\0'.
> 
> Signed-off-by: Patryk Małek <patryk.malek at intel.com>
> ---
>  drivers/net/ethernet/intel/i40e/i40e_main.c | 14 +++++++-------
> drivers/net/ethernet/intel/i40e/i40e_ptp.c  |  2 +-
>  2 files changed, 8 insertions(+), 8 deletions(-)

Tested-by: Andrew Bowers <andrewx.bowers at intel.com>




More information about the Intel-wired-lan mailing list