aboutsummaryrefslogtreecommitdiffstats
path: root/src/vlib/unix/cli.c
diff options
context:
space:
mode:
authorNeale Ranns <nranns@cisco.com>2017-12-05 13:34:36 -0800
committerNeale Ranns <nranns@cisco.com>2017-12-06 01:05:43 -0800
commit9c2c243062dd53a420f156ac3948b464fff833df (patch)
treee8124417689270ce2cd2a64ddef89aca7c257d01 /src/vlib/unix/cli.c
parent73cb0062e30ec09aa38bc98d91cbdfc86a8fb6c0 (diff)
fix bug in pager
the format statement can return NULL before the pager has pages. Change-Id: Ibabfd107e64fc9ab0eb142c28c155506f0d25828 Signed-off-by: Neale Ranns <nranns@cisco.com>
Diffstat (limited to 'src/vlib/unix/cli.c')
-rw-r--r--src/vlib/unix/cli.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/vlib/unix/cli.c b/src/vlib/unix/cli.c
index d484a0336f2..9f5862a036f 100644
--- a/src/vlib/unix/cli.c
+++ b/src/vlib/unix/cli.c
@@ -835,7 +835,7 @@ unix_cli_pager_redraw (unix_cli_file_t * cf, clib_file_t * uf)
static void
unix_cli_pager_add_line (unix_cli_file_t * cf, u8 * line, word len_or_index)
{
- u8 *p;
+ u8 *p = NULL;
word i, j, k;
word line_index, len;
u32 width = cf->width;
@@ -845,7 +845,8 @@ unix_cli_pager_add_line (unix_cli_file_t * cf, u8 * line, word len_or_index)
{
/* Use a line already in the pager buffer */
line_index = len_or_index;
- p = cf->pager_vector[line_index];
+ if (cf->pager_vector != NULL)
+ p = cf->pager_vector[line_index];
len = vec_len (p);
}
else