DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH] app/test-compress-perf: fix improper use of negative value
@ 2019-05-20 13:26 Tomasz Jozwiak
  2019-05-20 13:26 ` [dpdk-dev] [PATCH] app/test-compress-perf: fix reliance on integer endianness Tomasz Jozwiak
  2019-05-20 13:39 ` [dpdk-dev] [PATCH] app/test-compress-perf: fix improper use of negative value Trahe, Fiona
  0 siblings, 2 replies; 11+ messages in thread
From: Tomasz Jozwiak @ 2019-05-20 13:26 UTC (permalink / raw)
  To: dev, fiona.trahe, tomaszx.jozwiak, shallyv, stable

This patch fixes coverity issue: Improper use of negative value.
test_data->input_data_sz is passed to a parameter that
cannot be negative.

Coverity issue: 328504
Fixes: b68a82425da4 ("app/compress-perf: add performance measurement")
Cc: stable@dpdk.org

Signed-off-by: Tomasz Jozwiak <tomaszx.jozwiak@intel.com>
---
 app/test-compress-perf/main.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/app/test-compress-perf/main.c b/app/test-compress-perf/main.c
index c2a45d1..5a579ea 100644
--- a/app/test-compress-perf/main.c
+++ b/app/test-compress-perf/main.c
@@ -244,7 +244,8 @@ comp_perf_dump_input_data(struct comp_test_data *test_data)
 	if (test_data->input_data_sz == 0)
 		test_data->input_data_sz = actual_file_sz;
 
-	if (fseek(f, 0, SEEK_SET) != 0) {
+	if (test_data->input_data_sz <= 0 || actual_file_sz <= 0 ||
+			fseek(f, 0, SEEK_SET) != 0) {
 		RTE_LOG(ERR, USER1, "Size of input could not be calculated\n");
 		goto end;
 	}
-- 
2.7.4


^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2019-06-19 14:55 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-05-20 13:26 [dpdk-dev] [PATCH] app/test-compress-perf: fix improper use of negative value Tomasz Jozwiak
2019-05-20 13:26 ` [dpdk-dev] [PATCH] app/test-compress-perf: fix reliance on integer endianness Tomasz Jozwiak
2019-05-20 14:05   ` Trahe, Fiona
2019-05-20 14:25     ` Jozwiak, TomaszX
2019-05-21  6:47     ` Jozwiak, TomaszX
2019-05-21  8:03       ` Shally Verma
2019-05-21  8:47         ` Jozwiak, TomaszX
2019-05-29 13:46           ` Trahe, Fiona
2019-06-03 13:44             ` Shally Verma
2019-05-20 13:39 ` [dpdk-dev] [PATCH] app/test-compress-perf: fix improper use of negative value Trahe, Fiona
2019-06-19 14:55   ` Akhil Goyal

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).