[ python-Bugs-1346547 ] _subprocess.c calls PyInt_AsLong without error checking

SourceForge.net noreply at sourceforge.net
Thu Nov 10 22:10:05 CET 2005


Bugs item #1346547, was opened at 2005-11-03 03:34
Message generated for change (Settings changed) made by effbot
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1346547&group_id=5470

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: Windows
Group: Python 2.4
Status: Open
Resolution: None
Priority: 5
Submitted By: Luke (luked)
>Assigned to: Fredrik Lundh (effbot)
Summary: _subprocess.c calls PyInt_AsLong without error checking

Initial Comment:
_subprocess.c calls PyInt_AsLong without checking
whether the conversion produced an error.
This bug can cause an error to be reported at the wrong
point, eg:

Python 2.4.1 (#65, Mar 30 2005, 09:13:57) [MSC v.1310
32 bit (Intel)] on win32
Type "help", "copyright", "credits" or "license" for
more information.
>>> import subprocess
>>> si = subprocess.STARTUPINFO()
>>> si.wShowWindow = 2**65
>>> obj = subprocess.Popen('notepad.exe', startupinfo=si)
>>> 1+1
OverflowError: long int too large to convert to int
>>>

----------------------------------------------------------------------

Comment By: Neal Norwitz (nnorwitz)
Date: 2005-11-03 06:20

Message:
Logged In: YES 
user_id=33168

This code (for startupinfo) is only valid on Windows.  The
problem seems to be at lines 379 and 380 in
PC/_subprocess.c.  I'll let someone who can test this one
take care of it.  The return result from getint() needs to
be checked.

----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1346547&group_id=5470


More information about the Python-bugs-list mailing list