aboutsummaryrefslogtreecommitdiffstats
path: root/src/vat
diff options
context:
space:
mode:
authorOle Troan <ot@cisco.com>2018-12-14 20:34:29 +0100
committerDave Barach <openvpp@barachs.net>2018-12-14 22:50:51 +0000
commit884f0aff0e94ee35d7dd3c6dd55041d4872a9a9b (patch)
treedf99d8ee8db09d41fb8998ff97b95758f131d13c /src/vat
parentc5b6b3198069717f836807b57d01607c6711fb02 (diff)
String type: Fix off by one error
String is not sent nul terminated across API. The hardest two problems in computer science is cache invalidation naming and off by one errors. Change-Id: I36f1952ca955cb2d9dfb4c8120ec48c50ba17991 Signed-off-by: Ole Troan <ot@cisco.com>
Diffstat (limited to 'src/vat')
-rw-r--r--src/vat/api_format.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/vat/api_format.c b/src/vat/api_format.c
index 25d2dd3112a..f7e076764aa 100644
--- a/src/vat/api_format.c
+++ b/src/vat/api_format.c
@@ -6360,7 +6360,7 @@ exec_inband (vat_main_t * vam)
*/
u32 len = vec_len (vam->input->buffer);
M2 (CLI_INBAND, mp, len);
- vl_api_to_api_string (len, (const char *) vam->input->buffer, &mp->cmd);
+ vl_api_to_api_string (len - 1, (const char *) vam->input->buffer, &mp->cmd);
S (mp);
W (ret);