summaryrefslogtreecommitdiffstatshomepage
path: root/tests/extmod/ubinascii_micropython.py
diff options
context:
space:
mode:
authorDamien George <damien.p.george@gmail.com>2017-07-03 14:52:00 +1000
committerDamien George <damien.p.george@gmail.com>2017-07-03 14:52:00 +1000
commitb86c65d31c61af42a3b634c6a3150917509e3e8b (patch)
treeaf3cc988d8b1117c62f8c22f1430644325433966 /tests/extmod/ubinascii_micropython.py
parent45b127e7ac95308b51364b22f174c8b15d1f8e89 (diff)
downloadmicropython-b86c65d31c61af42a3b634c6a3150917509e3e8b.tar.gz
micropython-b86c65d31c61af42a3b634c6a3150917509e3e8b.zip
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.
Diffstat (limited to 'tests/extmod/ubinascii_micropython.py')
-rw-r--r--tests/extmod/ubinascii_micropython.py3
1 files changed, 3 insertions, 0 deletions
diff --git a/tests/extmod/ubinascii_micropython.py b/tests/extmod/ubinascii_micropython.py
index a4c00a2cb8..77084ec9ee 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':'))