]> git.baikalelectronics.ru Git - kernel.git/commit
i40e: Use scnprintf() for avoiding potential buffer overflow
authorTakashi Iwai <tiwai@suse.de>
Wed, 11 Mar 2020 08:37:40 +0000 (09:37 +0100)
committerJeff Kirsher <jeffrey.t.kirsher@intel.com>
Fri, 29 May 2020 02:51:51 +0000 (19:51 -0700)
commit754e56d3d5aa40cf25ebaa900655d511298cfd63
tree7bb4859b0b8fdd4f865359cdb60f5cf7027c4e99
parentd9e3526e2177a0a5d0c4676f4b64299ee8d1243e
i40e: Use scnprintf() for avoiding potential buffer overflow

Since snprintf() returns the would-be-output size instead of the
actual output size, the succeeding calls may go beyond the given
buffer limit.  Fix it by replacing with scnprintf().

Signed-off-by: Takashi Iwai <tiwai@suse.de>
Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
drivers/net/ethernet/intel/i40e/i40e_main.c