Soft Patch Panel
 help / color / mirror / Atom feed
* [spp] [PATCH] spp_nfv: fix buffer overflow
@ 2019-08-27  3:45 yasufum.o
  0 siblings, 0 replies; only message in thread
From: yasufum.o @ 2019-08-27  3:45 UTC (permalink / raw)
  To: spp, ferruh.yigit, yasufum.o

From: Yasufumi Ogawa <yasufum.o@gmail.com>

String `port_set` is used for containing a set of src and dst ports for
returned message. It is formatted as 39 chars as following, although its
buffer size is 32.
  "{\"src\":\"%s:%d\",\"dst\":\"%s:%d\"}"  // 39 chars

This update is to fix the bug by increasing buffer size to 128 which is
enough for the usage.

Signed-off-by: Yasufumi Ogawa <yasufum.o@gmail.com>
---
 src/nfv/commands.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/nfv/commands.h b/src/nfv/commands.h
index 6eda72f..499bdd4 100644
--- a/src/nfv/commands.h
+++ b/src/nfv/commands.h
@@ -141,7 +141,7 @@ parse_command(char *str)
 	int max_token = 0;
 	int ret = 0;
 	char result[16] = { 0 };  /* succeeded or failed. */
-	char port_set[32] = { 0 };
+	char port_set[128] = { 0 };
 	char *p_type;
 	int p_id;
 
-- 
2.17.1


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2019-08-27  3:45 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-08-27  3:45 [spp] [PATCH] spp_nfv: fix buffer overflow yasufum.o

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