Skip to content

Commit

Permalink
Update docs/Secure-Coding-Guide-for-Python/CWE-707/CWE-175/README.md
Browse files Browse the repository at this point in the history
Co-authored-by: myteron <myteron@gmail.com>
Signed-off-by: Hubert Daniszewski <61824500+s19110@users.noreply.github.com>
  • Loading branch information
s19110 and myteron authored Nov 28, 2024
1 parent 9de7604 commit 5216713
Showing 1 changed file with 1 addition and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -193,11 +193,8 @@ output = io.BytesIO()
wrapper = io.TextIOWrapper(output, encoding='utf-8', line_buffering=True)
wrapper.write(LOREM)
wrapper.seek(0, 0)
# Below outputs UnicodeDecodeError: 'utf-16-le' codec can't decode byte 0x2e in position 1336: truncated data
print(f"{len(output.getvalue().decode('utf-16le'))} characters in string")
#####################
# exploiting above code example
#####################
# UnicodeDecodeError: 'utf-16-le' codec can't decode byte 0x2e in position 1336: truncated data

```

Expand Down

0 comments on commit 5216713

Please sign in to comment.