> if (!strcmp(key, PDUMP_RX_DEV_ARG)) {
> - strncpy(pt->rx_dev, value, strlen(value));
> + strncpy(pt->rx_dev, value, sizeof(pt->rx_dev)-1);
I guess size-1 is to give room for terminating null byte, but for this
case is it guarantied that pt->rx_dev last byte is
On Wed, Jun 22, 2016 at 12:16:27PM +0530, Anupam Kapoor wrote:
> > if (!strcmp(key, PDUMP_RX_DEV_ARG)) {
> > - strncpy(pt->rx_dev, value, strlen(value));
> > + strncpy(pt->rx_dev, value, sizeof(pt->rx_dev)-1);
>
> I guess size-1 is to give room for terminating null
Hi,
> -Original Message-
> From: Richardson, Bruce
> Sent: Wednesday, June 22, 2016 10:22 AM
> To: Anupam Kapoor
> Cc: Yigit, Ferruh ; Pattan, Reshma
> ; dev at dpdk.org
> Subject: Re: [dpdk-dev] [PATCH 3/3] app/pdump: fix string overflow
>
> On Wed, Jun 2
On 6/21/2016 4:18 PM, Reshma Pattan wrote:
> using source length in strncpy can cause destination
> overflow if destination length is not big enough to
> handle the source string. Changes are made to use destination
> size instead of source length in strncpy.
>
> Coverity issue 127351: string
using source length in strncpy can cause destination
overflow if destination length is not big enough to
handle the source string. Changes are made to use destination
size instead of source length in strncpy.
Coverity issue 127351: string overflow
Fixes: caa7028276b8 ("app/pdump: add tool for
5 matches
Mail list logo