Project

General

Profile

Actions

Bug #3390

closed

vty segfaults when two commands "foo [<0-23>]" and "foo <0-23> bar" coexist

Added by neels almost 6 years ago. Updated almost 6 years ago.

Status:
Resolved
Priority:
Normal
Assignee:
Category:
-
Target version:
-
Start date:
07/09/2018
Due date:
% Done:

100%

Spec Reference:

Description

If a command exists as both with optional number argument and another variant with non-optional number argument, the vty causes use-after-free when

  • hitting tab (autocomplete) after the number arg
  • hitting enter after the number arg

This came to my attention when trying to add a 'show bts <0-255> neighbor ...' vty command, which forms this problem with 'show bts [<0-255>]'.
When duplicating to 'show bts' and 'show bts <0-255>', the problem does not occur.
When using a non-numeric arg, the problem does not occur.

A workaround is thus to copy the 'show bts' implementation, so that we don't need to use an optional arg.

Reproduction / backtrace follows.

Actions

Also available in: Atom PDF

Add picture from clipboard (Maximum size: 48.8 MB)