[spp] [PATCH 22/57] spp_vf: check upper limit to the number of process

x-fn-spp at sl.ntt-tx.co.jp x-fn-spp at sl.ntt-tx.co.jp
Thu Dec 28 05:55:29 CET 2017


From: Hiroyuki Nakamura <nakamura.hioryuki at po.ntt-tx.co.jp>

Add upper limit check of the number of process.

Signed-off-by: Kentaro Watanabe <watanabe.kentaro.z01 at as.ntt-tx.co.jp>
Signed-off-by: Yasufum Ogawa <ogawa.yasufumi at lab.ntt.co.jp>
---
 src/vf/spp_vf.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/src/vf/spp_vf.c b/src/vf/spp_vf.c
index e5dc1c9..6c6b832 100644
--- a/src/vf/spp_vf.c
+++ b/src/vf/spp_vf.c
@@ -317,6 +317,9 @@ parse_app_process_id(const char *process_id_str, int *process_id)
 	if (unlikely(process_id_str == endptr) || unlikely(*endptr != '\0'))
 		return -1;
 
+	if (id >= SPP_PROCESS_MAX)
+		return -1;
+
 	*process_id = id;
 	RTE_LOG(DEBUG, APP, "Set process id = %d\n", *process_id);
 	return 0;
-- 
1.9.1



More information about the spp mailing list