New submission from Christian Heimes:

Starting with Python 3.3 the select module access the uninitialized tv.tv_usec 
member of a timeval struct. I don't see the point of initializing the local 
variable long tv_usec from tv.tv_usec. The comment above the code states that 
long tv_usec is required as a workaround for Mac OS X.

http://hg.python.org/cpython/file/4754c4a710e6/Modules/selectmodule.c#l242

Coverity message:
CID 719694: Uninitialized scalar variable (UNINIT)At (5): Using uninitialized 
value "tv.tv_usec".
 242        long tv_usec = tv.tv_usec;
 243        if (_PyTime_ObjectToTimeval(tout, &tv.tv_sec, &tv_usec) == -1)
 244            return NULL;
 245        tv.tv_usec = tv_usec;

Suggested fix:
change line 242 to "long tv_usec;"

----------
keywords: 3.3regression
messages: 170299
nosy: christian.heimes
priority: normal
severity: normal
stage: patch review
status: open
title: select module uses uninitialized value "tv.tv_usec"
type: resource usage
versions: Python 3.3, Python 3.4

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue15921>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to