[dpdk-stable] patch 'examples/l3fwd-acl: check fseek return' has been queued to LTS release 16.11.4

luca.boccassi at gmail.com luca.boccassi at gmail.com
Mon Oct 30 16:35:08 CET 2017


Hi,

FYI, your patch has been queued to LTS release 16.11.4

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 11/01/17. So please
shout if anyone has objections.

Thanks.

Kind regards,
Luca Boccassi

---
>From 09cf3b1c4a30ba0bc1542826109d7806e4cb0881 Mon Sep 17 00:00:00 2001
From: Kuba Kozak <kubax.kozak at intel.com>
Date: Tue, 3 Oct 2017 13:48:02 +0200
Subject: [PATCH] examples/l3fwd-acl: check fseek return

[ upstream commit ab9cfe43c28efb3576396e7133af64b25b8785f3 ]

Add return value check and error handling for fseek call.

Coverity issue: 143435
Fixes: 361b2e9559fc ("acl: new sample l3fwd-acl")

Signed-off-by: Kuba Kozak <kubax.kozak at intel.com>
Acked-by: Konstantin Ananyev <konstantin.ananyev at intel.com>
Acked-by: Zhiyong Yang <zhiyong.yang at 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 9307d48c5..0d0d8bfc3 100644
--- a/examples/l3fwd-acl/main.c
+++ b/examples/l3fwd-acl/main.c
@@ -1027,6 +1027,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__,
@@ -1043,7 +1044,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.11.0



More information about the stable mailing list