Skip to content

Commit 7e90b77

Browse files
myterons19110
andauthored
Update docs/Secure-Coding-Guide-for-Python/CWE-682/CWE-1335/README.md
Co-authored-by: Hubert Daniszewski <[email protected]> Signed-off-by: myteron <[email protected]>
1 parent ecf2b53 commit 7e90b77

File tree

1 file changed

+1
-1
lines changed
  • docs/Secure-Coding-Guide-for-Python/CWE-682/CWE-1335

1 file changed

+1
-1
lines changed

docs/Secure-Coding-Guide-for-Python/CWE-682/CWE-1335/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# CWE-1335: Incorrect Bitwise Shift of Integer
22

3-
Ensure to know what bit-wise shift operators do in case you can not avoid them as recommended in *NUM01-P3 Do Not Perform Bit-wise and Arithmetic Operations* [[SEI CERT JAVA 2024]](https://eteamspace.internal.ericsson.com/pages/viewpage.action?pageId=1122687324) on the Same Data and use math instead.
3+
Ensure to know what bit-wise shift operators do in case you can not avoid them as recommended in *NUM01-J. Do not perform bitwise and arithmetic operations on the same data* [[SEI CERT JAVA 2024]](https://wiki.sei.cmu.edu/confluence/display/java/NUM01-J.+Do+not+perform+bitwise+and+arithmetic+operations+on+the+same+data) and use math instead.
44

55
A need to use bit-wise operations in Python can be due to translations or dealings with `C`, `C++` or `Java`, system libraries, raw binary data, or cryptographic algorithms. Existing Python modules hooking into system `C` libraries for cryptographic functions or math all to avoid the need to implement bit-shifting on a Python level. Bit-shifting can have unexpected outcomes. Python's ctypes module allows integration of `C` based system libraries into Python and direct access to C-type variables that can have different behavior than using high-level Python.
66

0 commit comments

Comments
 (0)