diff options
author | nnao45 <n4sekai5y@gmail.com> | 2017-11-08 00:06:00 +0900 |
---|---|---|
committer | FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp> | 2017-11-19 21:54:03 +0900 |
commit | 19858453d73bf6fb38eedac96e82a23f2d3632e5 (patch) | |
tree | ec252b6c9626fb08f4871a22d39df297da35cda3 /packet/bgp | |
parent | f32673bbec2541226657653af1042d0500a52d00 (diff) |
packet/bgp: fix flowspec parser about cmd badly args
Diffstat (limited to 'packet/bgp')
-rw-r--r-- | packet/bgp/bgp.go | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/packet/bgp/bgp.go b/packet/bgp/bgp.go index 380cbbb2..21dc892d 100644 --- a/packet/bgp/bgp.go +++ b/packet/bgp/bgp.go @@ -3014,6 +3014,10 @@ func parseDecValuesCmd(myCmd string, validationFunc func(int) error) ([][2]int, return nil, err } case DECLogicOpNameMap[DEC_LOGIC_OP_AND], DECLogicOpNameMap[DEC_LOGIC_OP_OR]: + if index == 0 { + err := fmt.Errorf("Logic operator appears a first character") + return nil, err + } bit := DECLogicOpValueMap[myCmdChar] decOperatorsAndValues = append(decOperatorsAndValues, operatorValue) if myCmdChar == DECLogicOpNameMap[DEC_LOGIC_OP_AND] { |