Skip to content

Commit

Permalink
fuzz/crypto: add {Get,Set}Index to compactbitarray fuzzing (#9200)
Browse files Browse the repository at this point in the history
Updates #7921
Depends on #9196
  • Loading branch information
Cuong Manh Le authored and odeke-em committed Jun 4, 2022
1 parent 68f9bf1 commit 03652f9
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 0 deletions.
Binary file not shown.
6 changes: 6 additions & 0 deletions fuzz/crypto/types/compactbitarray/marshalunmarshal/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,11 @@ func Fuzz(data []byte) int {
if cba == nil {
panic("Inconsistency, no error, yet BitArray is nil")
}
if cba.SetIndex(-1, true) {
panic("Set negative index success")
}
if cba.GetIndex(-1) {
panic("Get negative index success")
}
return 1
}
Binary file not shown.
2 changes: 2 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -361,6 +361,8 @@ github.com/dustin/go-humanize v1.0.0 h1:VSnTsYCnlFHaM2/igO1h6X3HA71jcobQuxemgkq4
github.com/dustin/go-humanize v1.0.0/go.mod h1:HtrtbFcZ19U5GC7JDqmcUSB87Iq5E25KnS6fMYU6eOk=
github.com/dvsekhvalnov/jose2go v0.0.0-20200901110807-248326c1351b h1:HBah4D48ypg3J7Np4N+HY/ZR76fx3HEUGxDU6Uk39oQ=
github.com/dvsekhvalnov/jose2go v0.0.0-20200901110807-248326c1351b/go.mod h1:7BvyPhdbLxMXIYTFPLsyJRFMsKmOZnQmzh6Gb+uquuM=
github.com/dvyukov/go-fuzz v0.0.0-20200318091601-be3528f3a813 h1:NgO45/5mBLRVfiXerEFzH6ikcZ7DNRPS639xFg3ENzU=
github.com/dvyukov/go-fuzz v0.0.0-20200318091601-be3528f3a813/go.mod h1:11Gm+ccJnvAhCNLlf5+cS9KjtbaD5I5zaZpFMsTHWTw=
github.com/eapache/go-resiliency v1.1.0/go.mod h1:kFI+JgMyC7bLPUVY133qvEBtVayf5mFgVsvEsIPBvNs=
github.com/eapache/go-xerial-snappy v0.0.0-20180814174437-776d5712da21/go.mod h1:+020luEh2TKB4/GOp8oxxtq0Daoen/Cii55CzbTV6DU=
github.com/eapache/queue v1.1.0/go.mod h1:6eCeP0CKFpHLu8blIFXhExK/dRa7WDZfr6jVFPTqq+I=
Expand Down

0 comments on commit 03652f9

Please sign in to comment.