DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH] librte_eal: fix wrong args operation in eal_parse_args
@ 2016-05-11  5:28 Ziye Yang
  2016-05-11 11:24 ` Bruce Richardson
  0 siblings, 1 reply; 6+ messages in thread
From: Ziye Yang @ 2016-05-11  5:28 UTC (permalink / raw)
  To: dev

This patch is used to fix wrong operation on user
input args. eal_parse_args function should not operate
the args passed by the user. If the element in argv
is generated by malloc function, changing it  will cause
memory issues when free the args.

Signed-off-by: Ziye Yang <ziye.yang@intel.com>
---
 lib/librte_eal/bsdapp/eal/eal.c   | 2 --
 lib/librte_eal/linuxapp/eal/eal.c | 2 --
 2 files changed, 4 deletions(-)

diff --git a/lib/librte_eal/bsdapp/eal/eal.c b/lib/librte_eal/bsdapp/eal/eal.c
index 06bfd4e..0eef92d 100644
--- a/lib/librte_eal/bsdapp/eal/eal.c
+++ b/lib/librte_eal/bsdapp/eal/eal.c
@@ -420,8 +420,6 @@ eal_parse_args(int argc, char **argv)
 		goto out;
 	}
 
-	if (optind >= 0)
-		argv[optind-1] = prgname;
 	ret = optind-1;
 
 out:
diff --git a/lib/librte_eal/linuxapp/eal/eal.c b/lib/librte_eal/linuxapp/eal/eal.c
index 8aafd51..ba9d1ac 100644
--- a/lib/librte_eal/linuxapp/eal/eal.c
+++ b/lib/librte_eal/linuxapp/eal/eal.c
@@ -658,8 +658,6 @@ eal_parse_args(int argc, char **argv)
 		goto out;
 	}
 
-	if (optind >= 0)
-		argv[optind-1] = prgname;
 	ret = optind-1;
 
 out:
-- 
1.9.3

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

end of thread, other threads:[~2016-05-11 14:07 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-05-11  5:28 [dpdk-dev] [PATCH] librte_eal: fix wrong args operation in eal_parse_args Ziye Yang
2016-05-11 11:24 ` Bruce Richardson
2016-05-11 11:51   ` Yang, Ziye
2016-05-11 12:21     ` Richardson, Bruce
2016-05-11 13:39       ` Yang, Ziye
2016-05-11 14:07         ` Richardson, Bruce

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