From b86c65d31c61af42a3b634c6a3150917509e3e8b Mon Sep 17 00:00:00 2001 From: Damien George Date: Mon, 3 Jul 2017 14:52:00 +1000 Subject: extmod/modubinascii: Add check for empty buffer passed to hexlify. Previous to this patch hexlify(b'', b':') would lead to a bad crash due to the computed length of the result being -1=0xffffffff. --- tests/extmod/ubinascii_micropython.py | 3 +++ 1 file changed, 3 insertions(+) (limited to 'tests/extmod/ubinascii_micropython.py') diff --git a/tests/extmod/ubinascii_micropython.py b/tests/extmod/ubinascii_micropython.py index a4c00a2cb..77084ec9e 100644 --- a/tests/extmod/ubinascii_micropython.py +++ b/tests/extmod/ubinascii_micropython.py @@ -10,3 +10,6 @@ except ImportError: # two arguments supported in uPy but not CPython a = binascii.hexlify(b'123', ':') print(a) + +# zero length buffer +print(binascii.hexlify(b'', b':')) -- cgit v1.2.3