diff options
author | Billy McFall <bmcfall@redhat.com> | 2017-02-15 09:03:06 -0500 |
---|---|---|
committer | Florin Coras <florin.coras@gmail.com> | 2017-02-16 08:21:54 +0000 |
commit | 205e934ee7530dac475be14d9054183625171ccc (patch) | |
tree | 35c22ccfa46a11211e76366d2b7407f3cd0098ed /src/plugins/snat/in2out.c | |
parent | 613c79f8c9fd99439e10141ba4e1fe0d463fc8a3 (diff) |
VPP-638: 'set interface ipsec key garbage' causes infinite loop
In the CLI parsing of 'set interface ipsec key garbage', the token
'garbage' enters the processing code for the <key>. This enters
unformat_hex_string(..) which looks through the input for 0-9,a-f and
drops out if a non-hex digit is encountered. The problem is that it
returns 1, indicating that input has been processed, but in this case,
no characters have been removed from the input string. This causes the
calling function to go to the top of the loop and process the next
token, which is now the same token and gets stuck in an infinite loop.
Updated unformat_hex_string(..) to return 0 if no characters were
processed.
This funcitons is used in multiple CLI Commands, but most have token
that preceeds the hex string. Since the token is stripped, the CLI
command is able to avoid an infinte loop.
Change-Id: Ib54f04f23c4d3563ec57a2450982d3648cedec0e
Signed-off-by: Billy McFall <bmcfall@redhat.com>
Diffstat (limited to 'src/plugins/snat/in2out.c')
0 files changed, 0 insertions, 0 deletions