[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20170714.090403.1626657578346063371.davem@davemloft.net>
Date: Fri, 14 Jul 2017 09:04:03 -0700 (PDT)
From: David Miller <davem@...emloft.net>
To: arnd@...db.de
Cc: linux-kernel@...r.kernel.org, skhare@...are.com,
pv-drivers@...are.com, gregkh@...uxfoundation.org,
torvalds@...ux-foundation.org, linux@...ck-us.net,
akpm@...ux-foundation.org, netdev@...r.kernel.org,
jejb@...ux.vnet.ibm.com, martin.petersen@...cle.com,
linux-scsi@...r.kernel.org, x86@...nel.org
Subject: Re: [PATCH 12/22] vmxnet3: avoid format strint overflow warning
From: Arnd Bergmann <arnd@...db.de>
Date: Fri, 14 Jul 2017 14:07:04 +0200
> gcc-7 notices that "-event-%d" could be more than 11 characters long
> if we had larger 'vector' numbers:
>
> drivers/net/vmxnet3/vmxnet3_drv.c: In function 'vmxnet3_activate_dev':
> drivers/net/vmxnet3/vmxnet3_drv.c:2095:40: error: 'sprintf' may write a terminating nul past the end of the destination [-Werror=format-overflow=]
> sprintf(intr->event_msi_vector_name, "%s-event-%d",
> ^~~~~~~~~~~~~
> drivers/net/vmxnet3/vmxnet3_drv.c:2095:3: note: 'sprintf' output between 9 and 33 bytes into a destination of size 32
>
> The current code is safe, but making the string a little longer
> is harmless and lets gcc see that it's ok.
>
> Signed-off-by: Arnd Bergmann <arnd@...db.de>
Applied.
Powered by blists - more mailing lists