aboutsummaryrefslogtreecommitdiffstats
path: root/src/vpp
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/vpp
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/vpp')
-rw-r--r--src/vpp/api/api.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/vpp/api/api.c b/src/vpp/api/api.c
index 1f376dcc64f..8e2e4cd75a6 100644
--- a/src/vpp/api/api.c
+++ b/src/vpp/api/api.c
@@ -219,7 +219,8 @@ vl_api_cli_inband_t_handler (vl_api_cli_inband_t * mp)
u8 *out_vec = 0;
u32 len = 0;
- if (vl_msg_api_get_msg_length (mp) < vl_api_string_len (&mp->cmd))
+ if (vl_msg_api_get_msg_length (mp) <
+ vl_api_string_len (&mp->cmd) + sizeof (*mp))
{
rv = -1;
goto error;