From cdeed0709ea7a38f4034147f678a26152df9332b Mon Sep 17 00:00:00 2001 From: Luke Dashjr Date: Sat, 28 Feb 2015 02:21:00 +0000 Subject: [PATCH] tests: Check decode with high bits set fails This doesn't catch out-of-bounds memory access, but it's a good test to have anyway. --- tests/decode-highbit-prefix.sh | 3 +++ tests/decode-highbit.sh | 3 +++ 2 files changed, 6 insertions(+) create mode 100644 tests/decode-highbit-prefix.sh create mode 100644 tests/decode-highbit.sh diff --git a/tests/decode-highbit-prefix.sh b/tests/decode-highbit-prefix.sh new file mode 100644 index 0000000..89bfe3f --- /dev/null +++ b/tests/decode-highbit-prefix.sh @@ -0,0 +1,3 @@ +#!/bin/sh +hex=$(echo 993233 | xxd -r -p | base58 -d 25 || echo FAIL) +test "x${hex}" = "xFAIL" diff --git a/tests/decode-highbit.sh b/tests/decode-highbit.sh new file mode 100644 index 0000000..a15ab0e --- /dev/null +++ b/tests/decode-highbit.sh @@ -0,0 +1,3 @@ +#!/bin/sh +hex=$(echo 319932 | xxd -r -p | base58 -d 25 || echo FAIL) +test "x${hex}" = "xFAIL"