From 6788f955c2414b025a4ea44efaf51caf50aa97f0 Mon Sep 17 00:00:00 2001 From: Felix Lange Date: Tue, 14 Apr 2015 12:28:19 +0200 Subject: rlp: fix handling of single byte zero when decoding into a pointer A single zero byte carries information and should not set the pointer to nil. This is arguably a corner case. While here, fix the comment to explain pointer reuse. --- rlp/decode_test.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'rlp/decode_test.go') diff --git a/rlp/decode_test.go b/rlp/decode_test.go index a64bfe3fd..e5c7f3761 100644 --- a/rlp/decode_test.go +++ b/rlp/decode_test.go @@ -378,7 +378,7 @@ var decodeTests = []decodeTest{ }, // pointers - {input: "00", ptr: new(*uint), value: (*uint)(nil)}, + {input: "00", ptr: new(*uint), value: uintp(0)}, {input: "80", ptr: new(*uint), value: (*uint)(nil)}, {input: "C0", ptr: new(*uint), value: (*uint)(nil)}, {input: "07", ptr: new(*uint), value: uintp(7)}, -- cgit