From: Ferruh Yigit <ferruh.yigit@intel.com>
To: Reshma Pattan <reshma.pattan@intel.com>, dev@dpdk.org
Subject: Re: [PATCH 2/3] pdump: fix string overflow
Date: Tue, 21 Jun 2016 18:14:09 +0100 [thread overview]
Message-ID: <576975E1.9030704@intel.com> (raw)
In-Reply-To: <1466522285-15023-3-git-send-email-reshma.pattan@intel.com>
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.
>
> Cverity issue 127350: string overflow
>
> Fixes: 278f945402c5 ("pdump: add new library for packet capture")
>
> Signed-off-by: Reshma Pattan <reshma.pattan@intel.com>
> ---
> lib/librte_pdump/rte_pdump.c | 9 +++++----
> 1 file changed, 5 insertions(+), 4 deletions(-)
>
> diff --git a/lib/librte_pdump/rte_pdump.c b/lib/librte_pdump/rte_pdump.c
> index dbc6816..05513d6 100644
> --- a/lib/librte_pdump/rte_pdump.c
> +++ b/lib/librte_pdump/rte_pdump.c
> @@ -460,8 +460,7 @@ pdump_get_socket_path(char *buffer, int bufsz, enum rte_pdump_socktype type)
> SOCKET_PATH_HOME, __func__, __LINE__);
> return -1;
> }
> - }
> - else
> + } else
syntax fix may be not belong to this patch
> dir = SOCKET_PATH_VAR_RUN;
> }
>
> @@ -800,13 +799,15 @@ pdump_prepare_client_request(char *device, uint16_t queue,
> req.flags = flags;
> req.op = operation;
> if ((operation & ENABLE) != 0) {
> - strncpy(req.data.en_v1.device, device, strlen(device));
> + strncpy(req.data.en_v1.device, device,
> + sizeof(req.data.en_v1.device)-1);
"-" missing spaces around
next prev parent reply other threads:[~2016-06-21 17:14 UTC|newest]
Thread overview: 41+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-06-21 15:18 [PATCH 0/3] fix coverity issues in packet capture framework Reshma Pattan
2016-06-21 15:18 ` [PATCH 1/3] pdump: check getenv return value Reshma Pattan
2016-06-21 16:55 ` Ferruh Yigit
2016-06-22 8:01 ` Pattan, Reshma
2016-06-21 15:18 ` [PATCH 2/3] pdump: fix string overflow Reshma Pattan
2016-06-21 17:14 ` Ferruh Yigit [this message]
2016-06-21 15:18 ` [PATCH 3/3] app/pdump: " Reshma Pattan
2016-06-21 17:21 ` Ferruh Yigit
2016-06-22 6:46 ` Anupam Kapoor
2016-06-22 9:21 ` Bruce Richardson
2016-06-22 9:24 ` Pattan, Reshma
2016-06-22 14:07 ` [PATCH v2 0/3] fix coverity issues in packet capture framework Reshma Pattan
2016-06-22 14:07 ` [PATCH v2 1/3] pdump: check getenv return value Reshma Pattan
2016-06-22 14:07 ` [PATCH v2 2/3] pdump: fix string overflow Reshma Pattan
2016-06-22 14:07 ` [PATCH v2 3/3] app/pdump: " Reshma Pattan
2016-06-23 14:36 ` [PATCH v3 0/4] fix issues in packet capture framework Reshma Pattan
2016-06-23 14:36 ` [PATCH v3 1/4] pdump: fix default socket path Reshma Pattan
2016-06-23 14:36 ` [PATCH v3 2/4] pdump: check getenv return value Reshma Pattan
2016-06-23 14:36 ` [PATCH v3 3/4] pdump: fix string overflow Reshma Pattan
2016-06-23 14:36 ` [PATCH v3 4/4] app/pdump: " Reshma Pattan
2016-06-24 13:54 ` [PATCH v4 0/5] fix issues in packet capture framework Reshma Pattan
2016-06-24 13:54 ` [PATCH v4 1/5] pdump: fix default socket path Reshma Pattan
2016-06-24 14:54 ` Thomas Monjalon
2016-06-24 15:05 ` Pattan, Reshma
2016-06-24 16:39 ` Pattan, Reshma
2016-06-24 13:54 ` [PATCH v4 2/5] pdump: check getenv return value Reshma Pattan
2016-06-24 13:54 ` [PATCH v4 3/5] pdump: fix string overflow Reshma Pattan
2016-06-24 13:54 ` [PATCH v4 4/5] app/pdump: " Reshma Pattan
2016-06-24 13:54 ` [PATCH v4 5/5] app/pdump: fix type casting of ring size Reshma Pattan
2016-06-24 16:36 ` [PATCH v5 0/5] fix issues in packet capture framework Reshma Pattan
2016-06-24 16:36 ` [PATCH v5 1/5] pdump: fix default socket path Reshma Pattan
2016-06-24 22:50 ` Mcnamara, John
2016-06-24 16:36 ` [PATCH v5 2/5] pdump: check getenv return value Reshma Pattan
2016-06-24 22:50 ` Mcnamara, John
2016-06-24 16:36 ` [PATCH v5 3/5] pdump: fix string overflow Reshma Pattan
2016-06-24 22:51 ` Mcnamara, John
2016-06-24 16:36 ` [PATCH v5 4/5] app/pdump: " Reshma Pattan
2016-06-24 22:51 ` Mcnamara, John
2016-06-24 16:36 ` [PATCH v5 5/5] app/pdump: fix type casting of ring size Reshma Pattan
2016-06-24 22:51 ` Mcnamara, John
2016-06-27 14:50 ` [PATCH v5 0/5] fix issues in packet capture framework Thomas Monjalon
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=576975E1.9030704@intel.com \
--to=ferruh.yigit@intel.com \
--cc=dev@dpdk.org \
--cc=reshma.pattan@intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.