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.

classification
Title: _subprocess.c calls PyInt_AsLong without error checking
Type: Stage:
Components: Windows Versions: Python 2.4
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: effbot Nosy List: effbot, luked, nnorwitz
Priority: normal Keywords:

Created on 2005-11-03 02:34 by luked, last changed 2022-04-11 14:56 by admin. This issue is now closed.

Messages (4)
msg26792 - (view) Author: Luke (luked) Date: 2005-11-03 02:34
_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
>>>
msg26793 - (view) Author: Neal Norwitz (nnorwitz) * (Python committer) Date: 2005-11-03 05:20
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.
msg26794 - (view) Author: Fredrik Lundh (effbot) * (Python committer) Date: 2005-11-10 22:43
Logged In: YES 
user_id=38376

I've added a fix to the subprocess patch over at
http://www.python.org/sf/1351997
msg26795 - (view) Author: Fredrik Lundh (effbot) * (Python committer) Date: 2005-11-12 10:28
Logged In: YES 
user_id=38376

Fixed along with #1351997.
History
Date User Action Args
2022-04-11 14:56:13adminsetgithub: 42548
2005-11-03 02:34:14lukedcreate