This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author christian.heimes
Recipients christian.heimes
Date 2012-09-11.12:46:33
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1347367594.05.0.129732037388.issue15921@psf.upfronthosting.co.za>
In-reply-to
Content
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;"
History
Date User Action Args
2012-09-11 12:46:34christian.heimessetrecipients: + christian.heimes
2012-09-11 12:46:34christian.heimessetmessageid: <1347367594.05.0.129732037388.issue15921@psf.upfronthosting.co.za>
2012-09-11 12:46:33christian.heimeslinkissue15921 messages
2012-09-11 12:46:33christian.heimescreate