summaryrefslogtreecommitdiffhomepage
path: root/packet/bgp/bgp.go
diff options
context:
space:
mode:
authornnao45 <n4sekai5y@gmail.com>2017-11-08 00:06:00 +0900
committerFUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>2017-11-19 21:54:03 +0900
commit19858453d73bf6fb38eedac96e82a23f2d3632e5 (patch)
treeec252b6c9626fb08f4871a22d39df297da35cda3 /packet/bgp/bgp.go
parentf32673bbec2541226657653af1042d0500a52d00 (diff)
packet/bgp: fix flowspec parser about cmd badly args
Diffstat (limited to 'packet/bgp/bgp.go')
-rw-r--r--packet/bgp/bgp.go4
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] {