Soft Patch Panel
 help / color / 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, back to index

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

Soft Patch Panel

Archives are clonable:
	git clone --mirror http://inbox.dpdk.org/spp/0 spp/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 spp spp/ http://inbox.dpdk.org/spp \
		spp@dpdk.org
	public-inbox-index spp


Newsgroup available over NNTP:
	nntp://inbox.dpdk.org/inbox.dpdk.spp


AGPL code for this site: git clone https://public-inbox.org/ public-inbox