| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
|
|
|
|
|
| |
Added checks for integer overflows, contributed by Google. Some are
only available if asserts are left in the code, in cases where they
can't be triggered from Python code.
|
|
|
|
|
|
|
| |
problems:
52448, 52468, 52472, 52475, 52646, 52797, 52802, 52863, 52999, 53001,
53101, 53371, 53373, 53383, 53384, 53736, 53812, 53921, 55578, 55580,
55581, 55772, 55775, 56557, 57093, 57094, 58630, 60114
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
SF patch #1630975: Fix crash when replacing sys.stdout in sitecustomize
When running the interpreter in an environment that would cause it to set
stdout/stderr/stdin's encoding, having a sitecustomize that would replace
them with something other than PyFile objects would crash the interpreter.
Fix it by simply ignoring the encoding-setting for non-files.
This could do with a test, but I can think of no maintainable and portable
way to test this bug, short of adding a sitecustomize.py to the buildsystem
and have it always run with it (hmmm....)
|
| |
|
|
|
|
| |
sys.callstats() match its docstring.
|
|
|
|
|
|
|
|
| |
the need for the out-of-tree universal binary support that was used to build
the 2.4.3 installer.
Missing here relative to that tree are some changes to IDLE, IMHO those patches
aren't appropriate for the 2.4 branch and users are better of using 2.5's IDLE.
|
|
|
|
|
| |
Fix #132 from Coverity, retval could have been derefed
if a continue inside a try failed.
|
|
|
|
|
|
|
|
|
|
|
|
| |
this code is only used if WITHOUT_COMPLEX is *not* defined, which is the
common case for Python builds.]
This code is actually not used unless WITHOUT_COMPLEX is defined.
However, there was no error checking that PyFloat_FromDouble returned
a valid pointer. I believe this change is correct as it seemed
to follow other code in the area.
Klocwork # 292.
|
|
|
|
|
|
|
| |
It's highly unlikely, though possible for PyEval_Get*() to return NULLs.
So be safe and do an XINCREF.
Klocwork # 221-222.
|
|
|
|
|
|
|
|
| |
Reported by Klocwork #151.
v2 can be NULL if exception2 is NULL. I don't think that condition can happen,
but I'm not sure it can't either. Now the code will protect against either
being NULL.
|
|
|
|
|
| |
Handle allocation failures gracefully. Found with failmalloc.
Many (all?) of these could be backported.
|
|
|
|
|
|
|
|
|
| |
cpathname could be NULL if it was longer than MAXPATHLEN. Don't try
to write the .pyc to NULL.
Check results of PyList_GetItem() and PyModule_GetDict() are not NULL.
Klocwork 282, 283, 285
|
|
|
|
|
|
|
| |
Move/copy assert for tstate != NULL before first use.
Verify that PyEval_Get{Globals,Locals} returned valid pointers.
Klocwork 231-232
|
|
|
|
|
|
|
|
|
|
|
|
| |
* unified the way intobject, longobject and mystrtoul handle
values around -sys.maxint-1.
* in general, trying to entierely avoid overflows in any computation
involving signed ints or longs is extremely involved. Fixed a few
simple cases where a compiler might be too clever (but that's all
guesswork).
* more overflow checks against bad data in marshal.c.
|
|
|
|
|
|
|
| |
Handle more mem alloc issues found with failmalloc
[The other half of this patch affected Python/symtable.c, and wasn't
relevant for the 2.4 branch. --amk]
|
|
|
|
|
|
| |
Handle a few more error conditions.
Klocwork 301 and 302. Will backport.
|
|
|
|
|
|
| |
PyModule_GetDict() can fail, produce fatal errors if this happens on startup.
Klocwork #298-299.
|
|
|
|
|
|
| |
Fix memory leak under some conditions.
Reported by Klocwork, #98.
|
|
|
|
|
|
|
|
|
| |
Fix an int/long mismatch identified here:
http://www.tortall.net/mu/blog/2005/12/01
Pointed out from SF #1365916.
Backport candidate.
|
|
|
|
|
|
| |
Check return result from Py_InitModule*(). This API can fail.
Probably should be backported.
|
|
|
|
| |
rev. 51158 and rev. 50843.
|
|
|
|
|
| |
sys.stdin is closed.
(backport from rev. 51129)
|
| |
|
|
|
|
| |
backport of rev 50787.
|
|
|
|
|
|
| |
Actually, checking for INT_MAX and INT_MIN is correct since
the format code explicitly handles a C "int".
(backport from rev. 46746)
|
|
|
|
|
|
| |
checking.
(backport from rev. 46741)
|
|
|
|
| |
Backport of fix for bug #1501223.
|
|
|
|
|
|
|
|
|
|
| |
Define MAXPATHLEN to be at least PATH_MAX, if that's defined. Python uses
MAXPATHLEN-sized buffers for various output-buffers (like to realpath()),
and that's correct on BSD platforms, but not Linux (which uses PATH_MAX, and
does not define MAXPATHLEN.) Cursory googling suggests Linux is following a
newer standard than BSD, but in cases like this, who knows. Using the
greater of PATH_MAX and 1024 as a fallback for MAXPATHLEN seems to be the
most portable solution.
|
|
|
|
| |
in dicts and sets when computing the total number of references.
|
|
|
|
| |
Fix a ref leak.
|
| |
|
|
|
|
|
| |
containing an encoding declaration is compile()d. Fixes
#1115379.
|
|
|
|
| |
by Coverity.
|
| |
|
|
|
|
|
| |
checked. Problem when 'warnings' was set to "error" and thus would re-raise a
new exception.
|
|
|
|
| |
signed and unsigned types in comparison.
|
|
|
|
|
|
|
|
|
| |
Patch 1413181, by Gabriel Becedillas.
PyThreadState_Delete(): if the auto-GIL-state machinery knows about
the thread state, forget it (since the thread state is being deleted,
continuing to remember it can't help, but can hurt if another thread
happens to get created with the same thread id).
|
| |
|
|
|
|
| |
silence compiler warnings on gcc 4.0.1 .
|
| |
|
| |
|
| |
|
|
|
|
|
|
| |
SF Bug #1350188, "setdlopenflags" leads to crash upon "import"
It was possible dlerror() returns a NULL pointer, use a default error
message in this case.
|
| |
|
|
|
|
| |
Fix SF bug #976608, Unhelpful error message when mtime of a module is -1
|
|
|
|
|
|
| |
SF bug #887946, segfault if redirecting directory
Also provide a warning if a directory is passed on the command line.
Add minimal command line test.
|
|
|
|
|
| |
Fix segfault with invalid coding.
(See SF bug: 772896 for another fix)
|
|
|
|
|
|
|
|
| |
[ 1307978 ] Unsatisfied symbols: _PyGILState_NoteThreadState (code)
(note that this only happens in a threads-disabled build).
Will forward port momentarily.
|
|
|
|
|
|
|
|
|
|
| |
Fix bug:
[ 1163563 ] Sub threads execute in restricted mode
basically by fixing bug 1010677 in a non-broken way.
Backport candidate.
|