Skip to content

Commit 45033c8

Browse files
s19110myteron
andauthored
Update docs/Secure-Coding-Guide-for-Python/CWE-707/CWE-175/noncompliant02.py
Co-authored-by: myteron <[email protected]> Signed-off-by: Hubert Daniszewski <[email protected]>
1 parent 5a5df3e commit 45033c8

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

docs/Secure-Coding-Guide-for-Python/CWE-707/CWE-175/noncompliant02.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,5 @@
1111
wrapper = io.TextIOWrapper(output, encoding='utf-8', line_buffering=True)
1212
wrapper.write(LOREM)
1313
wrapper.seek(0, 0)
14+
# Below outputs UnicodeDecodeError: 'utf-16-le' codec can't decode byte 0x2e in position 1336: truncated data
1415
print(f"{len(output.getvalue().decode('utf-16le'))} characters in string")
15-
#####################
16-
# exploiting above code example
17-
#####################
18-
# UnicodeDecodeError: 'utf-16-le' codec can't decode byte 0x2e in position 1336: truncated data

0 commit comments

Comments
 (0)