Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions Lib/base64.py
Original file line number Diff line number Diff line change
Expand Up @@ -462,9 +462,12 @@ def b85decode(b):
# Delay the initialization of tables to not waste memory
# if the function is never called
if _b85dec is None:
_b85dec = [None] * 256
# we don't assign to _b85dec directly to avoid issues when
# multiple threads call this function simultaneously
b85dec_tmp = [None] * 256
for i, c in enumerate(_b85alphabet):
_b85dec[c] = i
b85dec_tmp[c] = i
_b85dec = b85dec_tmp

b = _bytes_from_decode_data(b)
padding = (-len(b)) % 5
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Fix a thread safety issue with :func:`base64.b85decode`. Contributed by Benel Tayar.
Loading