aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorobscuren <geffobscura@gmail.com>2014-05-28 19:55:32 +0800
committerobscuren <geffobscura@gmail.com>2014-05-28 19:55:32 +0800
commita98e35d7a048850fb77fad49fff7364cf77a9bae (patch)
tree80f75570996ce88e119c6253810b12a22d887075
parent65722aeeca0fed685a00d660ddd7bb667ac3be9b (diff)
downloaddexon-a98e35d7a048850fb77fad49fff7364cf77a9bae.tar.gz
dexon-a98e35d7a048850fb77fad49fff7364cf77a9bae.tar.zst
dexon-a98e35d7a048850fb77fad49fff7364cf77a9bae.zip
Length checking
-rw-r--r--ethutil/bytes.go2
1 files changed, 1 insertions, 1 deletions
diff --git a/ethutil/bytes.go b/ethutil/bytes.go
index 075e40b4c..1c7a43af8 100644
--- a/ethutil/bytes.go
+++ b/ethutil/bytes.go
@@ -90,7 +90,7 @@ func IsHex(str string) bool {
}
func StringToByteFunc(str string, cb func(str string) []byte) (ret []byte) {
- if str[0:2] == "0x" {
+ if len(str) > 1 && str[0:2] == "0x" {
ret = FromHex(str[2:])
} else {
ret = cb(str)