1. Armin Rigo
  2. cpython-withatomic

Commits

Show all
Author Commit Message Date Builds
Andrew Kuchling
[Backport r51222 | neal.norwitz -- if you hack the code to set r=NULL, you find that Python does print "MemoryError". There's no traceback and no indication of which line of code is responsible, but it's better than a segfault.] Handle NULL nodes while parsing. I'm not entirely sure this is correct. There might be something else that needs to be done to setup the error. Klocwork #295.
Branches
2.4
Andrew Kuchling
[Backport r51246 | neal.norwitz] Handle a whole lot of failures from PyString_FromInternedString(). Should fix most of Klocwork 234-272. [Backport r51400 | neal.norwitz] Move initialization of interned strings to before allocating the object so we don't leak op. (Fixes an earlier patch to this code) Klockwork #350
Branches
2.4
Andrew Kuchling
[Backport r51221 | neal.norwitz -- the original commit message is wrong; 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.
Branches
2.4
Andrew Kuchling
[Backport r51220 | neal.norwitz] It's highly unlikely, though possible for PyEval_Get*() to return NULLs. So be safe and do an XINCREF. Klocwork # 221-222.
Branches
2.4
Andrew Kuchling
[Backport r50685 | neal.norwitz] 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.
Branches
2.4
Andrew Kuchling
[Backport r50783 | neal.norwitz. The bytes_left code is complicated, but looks correct on a casual inspection and hasn't been modified in the trunk. Does anyone want to review further?] Ensure we don't write beyond errText. I think I got this right, but it definitely could use some review to ensure I'm not off by one and there's no possible overflow/wrap-around of bytes_left. Reported by Klocwork #1. Fix a problem if there is a failure allocating self->db. Found with failmalloc.
Branches
2.4
Andrew Kuchling
[Partial backport of r51218 | neal.norwitz -- the changes to ast.c, symtable.c, and _elementtree.c weren't applicable] Klocwork made another run and found a bunch more problems. This is the first batch of fixes that should be easy to verify based on context. This fixes problem numbers: 220 (ast), 323-324 (symtable), 321-322 (structseq), 215 (array), 210 (hotshot), 182 (codecs), 209 (etree).
Branches
2.4
Andrew Kuchling
[Partial backport of r50773 | neal.norwitz -- other parts of this patch applied to pyarena.c, compile.c, and symtable.c, which were different in 2.4.] Fix more memory allocation issues found with failmalloc.
Branches
2.4
Andrew Kuchling
[Backport r50743 | neal.norwitz] Handle allocation failures gracefully. Found with failmalloc. Many (all?) of these could be backported.
Branches
2.4
Andrew Kuchling
[Backport r52147 | andrew.kuchling] Cause a PyObject_Malloc() failure to trigger a MemoryError, and then add 'if (PyErr_Occurred())' checks to various places so that NULL is returned properly.
Branches
2.4
Andrew Kuchling
[Backport r51223 | neal.norwitz] If _stat_float_times is false, we will try to INCREF ival which could be NULL. Return early in that case. The caller checks for PyErr_Occurred so this should be ok. Klocwork #297
Branches
2.4
Andrew Kuchling
[Backport r51224 | neal.norwitz] Move the assert which checks for a NULL pointer first. Klocwork #274.
Branches
2.4
Andrew Kuchling
[Backport r51247 | neal.norwitz] 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
Branches
2.4
Andrew Kuchling
[Backport r51248 | neal.norwitz] Fix segfault when doing string formatting on subclasses of long if __oct__, __hex__ don't return a string. Klocwork 308
Branches
2.4
Andrew Kuchling
[Backport r51255 | neal.norwitz] Really address the issue of where to place the assert for leftblock. (Followup of Klocwork 274)
Branches
2.4
Martin von Löwis
Remove bogus openssl-0.9.8a directory.
Branches
2.4
Martin von Löwis
Build _ssl.pyd with OpenSSL 0.9.7l
Branches
2.4
Andrew Kuchling
[Backport r51225 | neal.norwitz] Try to handle a malloc failure. I'm not entirely sure this is correct. There might be something else we need to do to handle the exception. Klocwork # 212-213 [I think this needs more work; a malloc() failure will cause a match to fail, but nothing raises MemoryError. I'll work on this on the trunk and backport. --amk]
Branches
2.4
Andrew Kuchling
[Backport r51232 | neal.norwitz] Verify verdat which is returned from malloc is not NULL. Ensure we don't pass NULL to free. Klocwork #306 (at least the first part, checking malloc)
Branches
2.4
Andrew Kuchling
[Backport r51245 | neal.norwitz] Move/copy assert for tstate != NULL before first use. Verify that PyEval_Get{Globals,Locals} returned valid pointers. Klocwork 231-232
Branches
2.4
Andrew Kuchling
[Backport r51251 | neal.norwitz] Handle malloc and fopen failures more gracefully. Klocwork 180-181
Branches
2.4
Andrew Kuchling
[Backport r51226 | neal.norwitz] I'm not sure why this code allocates this string for the error message. I think it would be better to always use snprintf and have the format limit the size of the name appropriately (like %.200s). Klocwork #340
Branches
2.4
Armin Rigo
Compilation problem caused by conflicting typedefs for uint32_t (unsigned long vs. unsigned int).
Branches
2.4
Armin Rigo
A review of overflow-detecting code in the 2.4 branch. * 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.
Branches
2.4
Martin von Löwis
Add uuids for upcoming 2.4.4 release.
Branches
2.4
Martin von Löwis
Patch #1570253: Fix build problems caused by backports.
Branches
2.4
Martin von Löwis
Fix integer negation and absolute value to not rely on undefined behaviour of the C compiler anymore.
Branches
2.4
Barry Warsaw
decode_rfc2231(): As Christian Robottom Reis points out, it makes no sense to test for parts > 3 when we use .split(..., 2).
Branches
2.4
Andrew Kuchling
[Backport r51252 | neal.norwitz] It's very unlikely, though possible that source is not a string. Verify that PyString_AsString() returns a valid pointer. (The problem can arise when zlib.decompress doesn't return a string.) Klocwork 346
Branches
2.4
Andrew Kuchling
[backport r51253 | neal.norwitz] Handle failures from lookup. Klocwork 341-342
Branches
2.4
  1. Prev
  2. Next