Skip to content

Commit

Permalink
fuzz: init for Candidate parsing
Browse files Browse the repository at this point in the history
  • Loading branch information
ernado committed Jul 28, 2018
1 parent 1b46acc commit 24dea4a
Show file tree
Hide file tree
Showing 9 changed files with 21 additions and 16 deletions.
20 changes: 4 additions & 16 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -11,22 +11,10 @@ bench:
go test -bench .
bench-record:
$(GO) test -bench . > "benchmarks/stun-go-$(GO_VERSION).txt"
fuzz-prepare-msg:
go-fuzz-build -func FuzzMessage -o stun-msg-fuzz.zip github.com/gortc/stun
fuzz-prepare-typ:
go-fuzz-build -func FuzzType -o stun-typ-fuzz.zip github.com/gortc/stun
fuzz-prepare-setters:
go-fuzz-build -func FuzzSetters -o stun-setters-fuzz.zip github.com/gortc/stun
fuzz-msg:
go-fuzz -bin=./stun-msg-fuzz.zip -workdir=examples/stun-msg
fuzz-typ:
go-fuzz -bin=./stun-typ-fuzz.zip -workdir=examples/stun-typ
fuzz-setters:
go-fuzz -bin=./stun-setters-fuzz.zip -workdir=examples/stun-setters
fuzz-test:
go test -tags gofuzz -run TestFuzz -v .
fuzz-reset-setters:
rm -f -v -r stun-setters-fuzz.zip examples/stun-setters
fuzz-prepare-candidate:
go-fuzz-build -func FuzzCandidate -o stun-candidate-fuzz.zip github.com/gortc/ice
fuzz-candidate:
go-fuzz -bin=./stun-candidate-fuzz.zip -workdir=fuzz/stun-setters
lint:
@echo "linting on $(PROCS) cores"
@gometalinter \
Expand Down
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
a22be8b05
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
a=cbe1�05
Binary file not shown.
Empty file.
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
シェル フランヘクタールペソ ペニヒ ヘルツ ペンス ページ ベータ ポイA
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
a=2be8b05
13 changes: 13 additions & 0 deletions ice_fuzz.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
// +build gofuzz

package ice

var c = new(Candidate)

func FuzzCandidate(data []byte) int {
c.Reset()
if err := ParseAttribute(data, c); err != nil {
return 0
}
return 1
}

0 comments on commit 24dea4a

Please sign in to comment.