* [dpdk-dev] [PATCH] example/ip_pipeline: fix config file parse defect
@ 2015-12-10 12:19 Fan Zhang
2015-12-10 21:31 ` Thomas Monjalon
0 siblings, 1 reply; 2+ messages in thread
From: Fan Zhang @ 2015-12-10 12:19 UTC (permalink / raw)
To: dev
Coverity issue: 120143
Fixes: 7f64b9c004aa ("examples/ip_pipeline: rework config file syntax")
Signed-off-by: Fan Zhang <roy.fan.zhang@intel.com>
Acked-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
---
examples/ip_pipeline/config_parse.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/examples/ip_pipeline/config_parse.c b/examples/ip_pipeline/config_parse.c
index 6aaca11..c7d5efc 100644
--- a/examples/ip_pipeline/config_parse.c
+++ b/examples/ip_pipeline/config_parse.c
@@ -1930,7 +1930,11 @@ app_config_parse(struct app_params *app, const char *file_name)
APP_CHECK(cfg != NULL, "Unable to load config file %s", file_name);
sect_count = rte_cfgfile_num_sections(cfg, NULL, 0);
+ APP_CHECK(sect_count > 0, "Number of sections return %d", sect_count);
+
section_names = malloc(sect_count * sizeof(char *));
+ APP_CHECK(section_names != NULL, "Failed to allocate memory");
+
for (i = 0; i < sect_count; i++)
section_names[i] = malloc(CFG_NAME_LEN);
--
2.5.0
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2015-12-10 21:33 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-12-10 12:19 [dpdk-dev] [PATCH] example/ip_pipeline: fix config file parse defect Fan Zhang
2015-12-10 21:31 ` Thomas Monjalon
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).