From: "Ananyev, Konstantin" <konstantin.ananyev@intel.com>
To: "Kozak, KubaX" <kubax.kozak@intel.com>
Cc: "dev@dpdk.org" <dev@dpdk.org>, "stable@dpdk.org" <stable@dpdk.org>
Subject: Re: [dpdk-stable] [PATCH] acl: fix unchecked return value
Date: Mon, 2 Oct 2017 14:21:51 +0000 [thread overview]
Message-ID: <2601191342CEEE43887BDE71AB9772585FAA2E99@IRSMSX103.ger.corp.intel.com> (raw)
In-Reply-To: <1505901708-526-1-git-send-email-kubax.kozak@intel.com>
> -----Original Message-----
> From: Kozak, KubaX
> Sent: Wednesday, September 20, 2017 11:02 AM
> To: Ananyev, Konstantin <konstantin.ananyev@intel.com>
> Cc: dev@dpdk.org; Kozak, KubaX <kubax.kozak@intel.com>; stable@dpdk.org
> Subject: [PATCH] acl: fix unchecked return value
>
> Add return value check and error handling for fseek call.
>
> Coverity issue: 143435
> Fixes: 361b2e9559fc ("acl: new sample l3fwd-acl")
> Cc: konstantin.ananyev@intel.com
> Cc: stable@dpdk.org
>
> Signed-off-by: Kuba Kozak <kubax.kozak@intel.com>
> ---
> examples/l3fwd-acl/main.c | 7 ++++++-
> 1 file changed, 6 insertions(+), 1 deletion(-)
>
> diff --git a/examples/l3fwd-acl/main.c b/examples/l3fwd-acl/main.c
> index 8eff4de..708e9eb 100644
> --- a/examples/l3fwd-acl/main.c
> +++ b/examples/l3fwd-acl/main.c
> @@ -1026,6 +1026,7 @@ add_rules(const char *rule_path,
> char buff[LINE_MAX];
> FILE *fh = fopen(rule_path, "rb");
> unsigned int i = 0;
> + int val;
>
> if (fh == NULL)
> rte_exit(EXIT_FAILURE, "%s: Open %s failed\n", __func__,
> @@ -1042,7 +1043,11 @@ add_rules(const char *rule_path,
> rte_exit(EXIT_FAILURE, "Not find any route entries in %s!\n",
> rule_path);
>
> - fseek(fh, 0, SEEK_SET);
> + val = fseek(fh, 0, SEEK_SET);
> + if (val < 0) {
> + rte_exit(EXIT_FAILURE, "%s: File seek operation failed\n",
> + __func__);
> + }
>
> acl_rules = calloc(acl_num, rule_size);
>
> --
> 2.7.4
Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
BTW, I think it should be l3fwd-acl inside the subject line.
next prev parent reply other threads:[~2017-10-02 14:21 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-09-20 10:01 Kuba Kozak
2017-10-02 14:13 ` [dpdk-stable] [dpdk-dev] " Jastrzebski, MichalX K
2017-10-02 14:21 ` Ananyev, Konstantin [this message]
2017-10-03 11:39 ` [dpdk-stable] " Kozak, KubaX
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=2601191342CEEE43887BDE71AB9772585FAA2E99@IRSMSX103.ger.corp.intel.com \
--to=konstantin.ananyev@intel.com \
--cc=dev@dpdk.org \
--cc=kubax.kozak@intel.com \
--cc=stable@dpdk.org \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).