[issue27587] Issues, reported by PVS-Studio static analyzer

Martin Panter report at bugs.python.org
Fri Jul 22 04:14:56 EDT 2016


Martin Panter added the comment:

Thanks for the report. You seem to have identified some code from Open SSL as being from Python (e.g. ASN1_PRINTABLE_type() function in a_print.c).

Here’s a quick copy of the details relevant to Python:

V547 Expression 's->sock_fd < 0' is always false. Unsigned type value is never < 0. Modules/socketmodule.c:655
V547 Expression 's->sock_fd < 0' is always false. Unsigned type value is never < 0. Modules/_ssl.c:1702
V547 Expression 'sock->sock_fd < 0' is always false. Unsigned type value is never < 0. Modules/_ssl.c:2018
Suggestion: compare with INVALID_SOCKET

V614 Potentially uninitialized pointer 'sigint_event' used. Modules/_multiprocessing/semaphore.c:120

V728 An excessive check can be simplified. The '||' operator is surrounded by opposite expressions 'quotetabs' and '!quotetabs'. Modules/binascii.c:1453

Null pointer check after use of “def” in _PyState_AddModule(), Python/pystate.c
V595 The 'self->extra' pointer was utilized before it was verified against nullptr. Check lines: 917, 923. Modules/_elementtree.c:917

The first two groups (sock_fd and sigint_event) look like Windows-specific code, and I suspect would be diagnosed with GCC (but building Python with GCC on Windows needs work).

----------
components: +Windows
nosy: +martin.panter, paul.moore, steve.dower, tim.golden, zach.ware
type: enhancement -> compile error

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue27587>
_______________________________________


More information about the Python-bugs-list mailing list