summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYasufumi Ogawa <yasufum.o@gmail.com>2019-08-27 12:45:28 +0900
committerYasufumi Ogawa <yasufum.o@gmail.com>2019-08-27 17:01:49 +0700
commit018721d456bad15aaaae9c4a342b6cbaa33b8346 (patch)
treee526309cd1c53acf681534dd2c5d71238d54bf21
parent446bc232ea82c83770a821e7cf964d1d620f3f9b (diff)
downloadspp-018721d456bad15aaaae9c4a342b6cbaa33b8346.zip
spp-018721d456bad15aaaae9c4a342b6cbaa33b8346.tar.gz
spp-018721d456bad15aaaae9c4a342b6cbaa33b8346.tar.xz
spp_nfv: fix buffer overflow
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>
-rw-r--r--src/nfv/commands.h2
1 files changed, 1 insertions, 1 deletions
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;