Skip to content

Commit

Permalink
fix : codeQL #226
Browse files Browse the repository at this point in the history
  • Loading branch information
0xsharma committed Jan 30, 2024
1 parent f66e2c2 commit 5513226
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions common/hexutil/hexutil.go
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,10 @@ func MustDecode(input string) []byte {

// Encode encodes b as a hex string with 0x prefix.
func Encode(b []byte) string {
if len(b) > 64*1024*1024 {
return ""
}

enc := make([]byte, len(b)*2+2)
copy(enc, "0x")
hex.Encode(enc[2:], b)
Expand Down

0 comments on commit 5513226

Please sign in to comment.