-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
SocketNoTimeout needs to check for 0 and negative timeouts
The SocketNoTimeout rule also needs to check for timeout values of 0 or less than 0 which also equate to no timeout. The value can also be of type float. Signed-off-by: Eric Brown <[email protected]>
- Loading branch information
Showing
3 changed files
with
18 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
11 changes: 11 additions & 0 deletions
11
tests/unit/rules/python/stdlib/socket/examples/socket_create_connection_timeout_0.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
# level: WARNING | ||
# start_line: 9 | ||
# end_line: 9 | ||
# start_column: 56 | ||
# end_column: 57 | ||
import socket | ||
|
||
|
||
s = socket.create_connection(("127.0.0.1", 80), timeout=0) | ||
s.recv(1024) | ||
s.close() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters