]> git.proxmox.com Git - mirror_frr.git/commit
lib: fix vtysh core when handling questionmark
authorYuan Yuan <yyuanam@amazon.com>
Tue, 30 May 2023 19:20:09 +0000 (19:20 +0000)
committerYuan Yuan <yyuanam@amazon.com>
Wed, 31 May 2023 20:30:03 +0000 (20:30 +0000)
commitf8aa257997a6a6f69ec5d5715ab04d7cbfae1d1c
tree6cb19ceaeb2df6fc7b91bac1308966df12aa1c43
parent147c7a2de355c3733604474840902762b51062ae
lib: fix vtysh core when handling questionmark

When issue vtysh command with ?, the initial buf size for the
element is 16. Then it would loop through each element in the cmd
output vector. If the required size for printing out the next
element is larger than the current buf size, realloc the buf memory
by doubling the current buf size regardless of the actual size
that's needed. This would cause vtysh core when the doubled size
is not enough for the next element.

Signed-off-by: Yuan Yuan <yyuanam@amazon.com>
lib/command.c