summaryrefslogtreecommitdiffstats
path: root/src/vnet/tls
diff options
context:
space:
mode:
authorDave Wallace <dwallacelf@gmail.com>2019-10-30 17:53:56 +0000
committerAndrew Yourtchenko <ayourtch@gmail.com>2019-11-18 13:14:44 +0000
commitf821dd79900a891fb6489712d02992330defc2f5 (patch)
tree045540b232d699f05241994a796b35a5e78d152b /src/vnet/tls
parentaf62709c7421ae12fec2faf096664fed24c185f2 (diff)
tls: fifo size is u32
- unformat_memory_size() writes to a uword * - Limit cli input to u32 Type: fix Signed-off-by: Dave Wallace <dwallacelf@gmail.com> Change-Id: I453a5633e04f9ee6f2f1a843634f99063a81579b (cherry picked from commit b1a81aa67942aa1b5a97a4199310c9ffeaab1f5f)
Diffstat (limited to 'src/vnet/tls')
-rw-r--r--src/vnet/tls/tls.c13
1 files changed, 10 insertions, 3 deletions
diff --git a/src/vnet/tls/tls.c b/src/vnet/tls/tls.c
index f2243e677b7..9f997f18c95 100644
--- a/src/vnet/tls/tls.c
+++ b/src/vnet/tls/tls.c
@@ -890,6 +890,7 @@ static clib_error_t *
tls_config_fn (vlib_main_t * vm, unformat_input_t * input)
{
tls_main_t *tm = &tls_main;
+ uword tmp;
while (unformat_check_input (input) != UNFORMAT_END_OF_INPUT)
{
if (unformat (input, "use-test-cert-in-ca"))
@@ -899,9 +900,15 @@ tls_config_fn (vlib_main_t * vm, unformat_input_t * input)
else if (unformat (input, "first-segment-size %U", unformat_memory_size,
&tm->first_seg_size))
;
- else if (unformat (input, "fifo-size %U", unformat_memory_size,
- &tm->fifo_size))
- ;
+ else if (unformat (input, "fifo-size %U", unformat_memory_size, &tmp))
+ {
+ if (tmp >= 0x100000000ULL)
+ {
+ return clib_error_return
+ (0, "fifo-size %llu (0x%llx) too large", tmp, tmp);
+ }
+ tm->fifo_size = tmp;
+ }
else
return clib_error_return (0, "unknown input `%U'",
format_unformat_error, input);