Skip to content

Commit

Permalink
fuzz: add crypto/types.BitArray CompactUnmarshal fuzzer (cosmos#9166)
Browse files Browse the repository at this point in the history
Updates cosmos#7921.
  • Loading branch information
odeke-em authored and elias-orijtech committed May 6, 2022
1 parent 2f9d3ca commit be1c07e
Show file tree
Hide file tree
Showing 21 changed files with 26 additions and 0 deletions.
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
��
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
��Ԭ�F
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
�Ԁԋ�����
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
���Ԁԋ�����Ԁԋ��
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
��%
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
����f
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
���%
Binary file not shown.
Binary file not shown.
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
�ԋ���
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
����Ԁ��Ԁ��Ԁԋ���Ԁ�Ԁ��Ԁ��Ԁԋ���Ԁ�Ԁԋ���Ԁ���ԋ���Ԁ���Ԁ��Ԁ�ԋ��
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
���Ԁ��Ԁ�Ԁԋ���Ԁ���Ԁ��Ԁ�ԋ��
16 changes: 16 additions & 0 deletions fuzz/crypto/types/CompactBitArray/marshalUnmarshal/main.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
package marshalunmarshal

import (
"github.com/cosmos/cosmos-sdk/crypto/types"
)

func Fuzz(data []byte) int {
cba, err := types.CompactUnmarshal(data)
if err != nil {
return 0
}
if cba == nil {
panic("Inconsistency, no error, yet BitArray is nil")
}
return 1
}

0 comments on commit be1c07e

Please sign in to comment.