From aa71e27a3b0f42b980082c52232c68fb50a45052 Mon Sep 17 00:00:00 2001 From: Taylor Gerring Date: Thu, 2 Apr 2015 15:53:04 +0200 Subject: Detect non-valid strings for blockheight --- rpc/args.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'rpc') diff --git a/rpc/args.go b/rpc/args.go index a8cb7dcb1..cebabf4ba 100644 --- a/rpc/args.go +++ b/rpc/args.go @@ -41,7 +41,11 @@ func blockHeight(raw interface{}, number *int64) error { case "pending": *number = -2 default: - *number = common.String2Big(str).Int64() + if common.HasHexPrefix(str) { + *number = common.String2Big(str).Int64() + } else { + return NewInvalidTypeError("blockNumber", "is not a valid string") + } } return nil -- cgit