diff options
author | Florin Coras <fcoras@cisco.com> | 2018-03-18 08:22:17 -0700 |
---|---|---|
committer | Chris Luke <chris_luke@comcast.com> | 2018-03-19 17:15:56 +0000 |
commit | 5090c57c4d1778b40ed77d31d1dd85eb3123c528 (patch) | |
tree | e877c0270765417832134e62b98c5cdf3056898c /src/vnet/session/session_api.c | |
parent | 19bd1902cb8cc074470f1e178d1df0601f75f58b (diff) |
session: fix coverity warnings
Change-Id: I022dc40476ea9c30957b12bf1bd0629c6eb41cda
Signed-off-by: Florin Coras <fcoras@cisco.com>
Diffstat (limited to 'src/vnet/session/session_api.c')
-rwxr-xr-x | src/vnet/session/session_api.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/vnet/session/session_api.c b/src/vnet/session/session_api.c index ca739fa3996..9236b19a5d0 100755 --- a/src/vnet/session/session_api.c +++ b/src/vnet/session/session_api.c @@ -1131,6 +1131,11 @@ vl_api_application_tls_cert_add_t_handler (vl_api_application_tls_cert_add_t * memset (a, 0, sizeof (*a)); a->app_index = app->index; cert_len = clib_net_to_host_u16 (mp->cert_len); + if (cert_len > 10000) + { + rv = VNET_API_ERROR_INVALID_VALUE; + goto done; + } vec_validate (a->cert, cert_len); clib_memcpy (a->cert, mp->cert, cert_len); if ((error = vnet_app_add_tls_cert (a))) @@ -1166,6 +1171,11 @@ vl_api_application_tls_key_add_t_handler (vl_api_application_tls_key_add_t * memset (a, 0, sizeof (*a)); a->app_index = app->index; key_len = clib_net_to_host_u16 (mp->key_len); + if (key_len > 10000) + { + rv = VNET_API_ERROR_INVALID_VALUE; + goto done; + } vec_validate (a->key, key_len); clib_memcpy (a->key, mp->key, key_len); if ((error = vnet_app_add_tls_key (a))) |