Issue 18550: internal_setblocking() doesn't check return value of fcntl() (original) (raw)

Created on 2013-07-24 19:39 by christian.heimes, last changed 2022-04-11 14:57 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
issue-18550.patch ronaldoussoren,2013-09-02 11:55
Messages (6)
msg193670 - (view) Author: Christian Heimes (christian.heimes) * (Python committer) Date: 2013-07-24 19:39
http://hg.python.org/cpython/file/96d817f41c4c/Modules/socketmodule.c#l614 CID 715331 (#1 of 1): Unchecked return value from library (CHECKED_RETURN) 5. check_return: Calling function "fcntl(s->sock_fd, 4, delay_flag)" without checking return value. This library function may fail and return an error code. It's rather tedious to fix the issue. No function checks the return value of internal_setblocking()...
msg194155 - (view) Author: Ronald Oussoren (ronaldoussoren) * (Python committer) Date: 2013-08-02 05:51
It's a bit tedious, but not too bad. The attached patch appears to work, but needs review (especially for the Windows and VMS branches in internal_setblocking. This changes the return value of internal_setblocking, it was unconditionally 1 and is now -1 if the call fails and 0 otherwise.
msg196508 - (view) Author: Madison May (madison.may) * Date: 2013-08-30 04:23
The attached patch? :)
msg196780 - (view) Author: Ronald Oussoren (ronaldoussoren) * (Python committer) Date: 2013-09-02 11:55
oops. This should be the right patch.
msg200728 - (view) Author: Christian Heimes (christian.heimes) * (Python committer) Date: 2013-10-21 08:59
LGTM The patch silences the coverity warnings, too. Does anybody else like to do a code review?
msg275190 - (view) Author: Roundup Robot (python-dev) (Python triager) Date: 2016-09-08 22:34
New changeset 0a52c66f31f5 by Christian Heimes in branch 'default': Issue 18550: Check return value of ioctl() / fnctl() in internal_setblocking https://hg.python.org/cpython/rev/0a52c66f31f5
History
Date User Action Args
2022-04-11 14:57:48 admin set github: 62750
2016-09-08 22:35:53 christian.heimes set status: open -> closedresolution: fixedstage: patch review -> resolved
2016-09-08 22:34:07 python-dev set nosy: + python-devmessages: +
2016-06-12 11:25:19 christian.heimes set assignee: christian.heimes ->
2013-11-17 14:20:07 christian.heimes set assignee: christian.heimes
2013-10-21 08:59:42 christian.heimes set messages: +
2013-09-02 11:55:06 ronaldoussoren set files: + issue-18550.patchmessages: +
2013-08-30 04:23:26 madison.may set nosy: + madison.maymessages: +
2013-08-30 03:56:16 asvetlov set nosy: + asvetlov
2013-08-02 05:51:19 ronaldoussoren set nosy: + ronaldoussorenmessages: + keywords: + patch, needs reviewstage: needs patch -> patch review
2013-07-24 19:39:39 christian.heimes create