summaryrefslogtreecommitdiffstats
path: root/Objects
Commit message (Collapse)AuthorAgeFilesLines
* Backport rev 51262 from trunk -- squashes a compiler warning on WindowsTim Peters2006-10-091-2/+2
| | | | | | | | | | about truly wrong code. Checkin comment from 51262: Can't return NULL from a void function. If there is a memory error, about the best we can do is call PyErr_WriteUnraisable and go on. We won't be able to do the call below either, so verify delstr is valid.
* Backport of the pieces of trunk rev 46589 relevant toTim Peters2006-10-091-1/+31
| | | | | | | | | | | | | fixing an unlikely crash bug in dict resizing, SF bug 1456209. The rest of rev 46589 changes whether Python suppresses exceptions during some dict-related comparisons. While I think that's a good idea, it does change visible behavior at times, and there was already some complaining about that on the trunk. Not a good idea for backporting. The part of 46589 checked in here can at worst stop segfaults, and I doubt anyone will gripe about that ;-)
* [Partial backport of r45947 | neal.norwitz]Andrew M. Kuchling2006-10-091-2/+3
| | | | | | | | | | Fix problems found by Coverity. longobject.c: also fix an ssize_t problem <a> could have been NULL, so hoist the size calc to not use <a>. [The ssize_t change isn't needed for 2.4. The other changes in this revision are to modules not present in 2.4. --amk]
* [Backport r42951 | guido.van.rossum]Andrew M. Kuchling2006-10-091-2/+6
| | | | | | | | | Fix three nits found by Coverity, adding null checks and comments. [This commit only makes two changes. One change in the original patch is just adding a comment, and another adds a 'base != NULL' check to silence Coverity, but a comment adds that that base is never going to be NULL. I didn't backport that change. --amk]
* [Backport r43695 | neal.norwitz]Andrew M. Kuchling2006-10-061-8/+5
| | | | | | Remove dead code (reported by HP compiler). Can probably be backported if anyone cares.
* [Backport r50679 | neal.norwitz. This is the last Klocwork bug to beAndrew M. Kuchling2006-10-051-7/+7
| | | | | | | | | | | | backported.] Use sizeof(buffer) instead of duplicating the constants to ensure they won't be wrong. The real change is to pass (bufsz - 1) to PyOS_ascii_formatd and 1 to strncat. strncat copies n+1 bytes from src (not dest). Reported by Klocwork #58.
* [Backport r50681 | neal.norwitz]Andrew M. Kuchling2006-10-051-2/+2
| | | | | | | PyFunction_SetDefaults() is documented as taking None or a tuple. A NULL would crash the PyTuple_Check(). Now make NULL return a SystemError. Reported by Klocwork #73.
* [Backport r51246 | neal.norwitz]Andrew M. Kuchling2006-10-051-30/+110
| | | | | | | | | | | | | 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
* [Partial backport of r51218 | neal.norwitz -- the changes to ast.c, symtable.c,Andrew M. Kuchling2006-10-051-0/+4
| | | | | | | | | 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).
* [Backport r50743 | neal.norwitz]Andrew M. Kuchling2006-10-052-0/+5
| | | | | Handle allocation failures gracefully. Found with failmalloc. Many (all?) of these could be backported.
* [Backport r51248 | neal.norwitz]Andrew M. Kuchling2006-10-051-1/+4
| | | | | | | Fix segfault when doing string formatting on subclasses of long if __oct__, __hex__ don't return a string. Klocwork 308
* A review of overflow-detecting code in the 2.4 branch.Armin Rigo2006-10-047-37/+70
| | | | | | | | | | | | * 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.
* Fix integer negation and absolute value to not relyMartin v. Löwis2006-10-041-4/+3
| | | | on undefined behaviour of the C compiler anymore.
* [Backport r51230 | neal.norwitz]Andrew M. Kuchling2006-10-031-2/+6
| | | | | | | Check return of PyMem_MALLOC (garbage) is non-NULL. Check seq in both portions of if/else. Klocwork #289-290.
* [Backport r50779 | neal.norwitz]Andrew M. Kuchling2006-10-031-1/+2
| | | | | | | | Move the initialization of size_a down below the check for a being NULL. Reported by Klocwork #106. [Slight change required: in 2.5 Py_ssize_t is used, but 2.4 uses int.]
* [Backport r50683 | neal.norwitz]Andrew M. Kuchling2006-10-031-3/+6
| | | | | | | Stop INCREFing name, then checking if it's NULL. name (f_name) should never be NULL so assert it. Fix one place where we could have passed NULL. Reported by Klocwork #66.
* [Backport r50680 | neal.norwitz]Andrew M. Kuchling2006-10-031-3/+3
| | | | Handle a NULL name properly.
* [Backport rev. 42545 by georg.brandl]Andrew M. Kuchling2006-10-031-0/+4
| | | | Make staticmethod and classmethod complain about keyword args.
* [Backport rev. 51669 by brett.cannon]Andrew M. Kuchling2006-10-031-1/+1
| | | | | | Make sure memory is properly cleaned up in file_init. Backport candidate.
* [Backport rev. 47171 by neal.norwitz]Andrew M. Kuchling2006-10-031-0/+2
| | | | Another problem reported by Coverity. Backport candidate.
* Patch #1567691: super() and new.instancemethod() now don't acceptGeorg Brandl2006-09-302-0/+4
| | | | | | keyword arguments any more (previously they accepted them, but didn't use them). (backport from rev. 52058)
* [Backport rev. 46878 by neal.norwitz]Andrew M. Kuchling2006-09-291-1/+3
| | | | | Don't leak the list object if there's an error allocating the item storage. Backport candidate.
* [Backport rev. 39743 by lemburg]Andrew M. Kuchling2006-09-291-8/+16
| | | | | | Bug fix for [ 1331062 ] utf 7 codec broken. Backport candidate.
* Merge rev 51711 from the 2.5 branch.Tim Peters2006-09-051-2/+8
| | | | | | i_divmod(): As discussed on Python-Dev, changed the overflow checking to live happily with recent gcc optimizations that assume signed integer arithmetic never overflows.
* Backport rev 51448:Georg Brandl2006-08-221-12/+25
| | | | | - Patch #1541585: fix buffer overrun when performing repr() on a unicode string in a build with wide unicode (UCS-4) support.
* memcmp() can return values other than -1, 0, and +1 but tp_compareThomas Heller2006-08-081-1/+1
| | | | must not.
* SF patch #1534048 (bug #1531003): fix typo in error messageFred Drake2006-08-041-1/+1
|
* Put method-wrappers into trashcan. Fixes #927248.Martin v. Löwis2006-07-031-1/+3
|
* Backport of r47061.Armin Rigo2006-06-212-5/+10
|
* Classic class that defined ``def __coerce__(self, other): return other, self``Brett Cannon2006-06-131-0/+3
| | | | | | | would infinitely recourse and segfault the interpreter. Now a recursion check occurs after a coercion. Backport of fix for bug #992017.
* Fix bug introduced in rev. 46807 where variable was not declared at top of ↵Brett Cannon2006-06-091-1/+2
| | | | block.
* Backport of fix of bug #532646 for new-style classes.Brett Cannon2006-06-091-0/+3
|
* Don't crash on Py_UNICODE values < 0. Fixes #1454485.Martin v. Löwis2006-06-051-1/+3
|
* Backport: Patch #1488312, Fix memory alignment problem on SPARC in unicode.Neal Norwitz2006-05-151-1/+1
|
* Ignore the references to the dummy objects used as deleted keysArmin Rigo2006-04-122-1/+22
| | | | in dicts and sets when computing the total number of references.
* Bug #1177964: make file iterator raise MemoryError on too big filesGeorg Brandl2006-03-311-1/+2
| | | | (backport from rev. 43506)
* after discussions with perky, reverted fix for Bug #1379994: BuiltinAnthony Baxter2006-03-281-3/+3
| | | | | | | | | unicode_escape and raw_unicode_escape codec now encodes backslash correctly. This caused another issue for unicode repr strings being double-escaped (SF Bug #1459029). Correct fix will be in 2.5, but is too risky for 2.4.3. Added a testcase for #1459029.
* Fix the refleak from test_unicode.Neal Norwitz2006-03-281-13/+16
| | | | | | | | | | | | Backport 42973 (lots of whitespace changes intermixed): - Reindent a confusingly indented piece of code (no intended code changes there) - Add missing DECREFs of inner-scope 'temp' variable - Add various missing DECREFs by changing 'return NULL' into 'goto onError' - Avoid double DECREF when last _PyUnicode_Resize() fails Coverity found one of the missing DECREFs, but oddly enough not the others.
* update - still some old .cvsignore files lying aroundAnthony Baxter2006-03-231-2/+0
|
* Backport: Fix missing NULL checks after PyTuple_New, PyList_New, PyDict_NewGeorg Brandl2006-03-172-1/+5
|
* Backport 43022:Neal Norwitz2006-03-141-5/+7
| | | | | | | | | | | | Fix and test (manually w/xx module) passing NULLs to PyObject_Str() and PyObject_Unicode(). This problem was originally reported from Coverity and addresses mail on python-dev "checkin r43015". This inlines the conversion of the string to unicode and cleans up/simplifies some code at the end of the PyObject_Unicode(). We really need a complete C API test module for all public APIs and passing good and bad parameter values.
* Fix bug found by Coverity: don't allow NULL argument to PyUnicode_CheckExactGeorg Brandl2006-03-131-2/+2
| | | | (backport from rev. 43014)
* Backport r42894: SF #1444030 Fix several potential defects foundHye-Shik Chang2006-03-074-11/+30
| | | | by Coverity.
* Backported from r41842.Armin Rigo2006-02-202-22/+60
|
* Fix SF #1412837, compile failed with Watcom compilerNeal Norwitz2006-01-241-5/+5
|
* Backport:Neal Norwitz2006-01-101-16/+21
| | | | | | | | | | | | | | | | - Patch #1400181, fix unicode string formatting to not use the locale. This is how string objects work. u'%f' could use , instead of . for the decimal point. Now both strings and unicode always use periods. This is the code that would break: import locale locale.setlocale(locale.LC_NUMERIC, 'de_DE') u'%.1f' % 1.0 assert '1.0' == u'%.1f' % 1.0 I couldn't create a test case which fails, but this fixes the problem. (tested in interpreter and reported fixed by others)
* Bug #1379994: Fix *unicode_escape codecs to encode r'\' as r'\\'Hye-Shik Chang2005-12-171-3/+3
| | | | just like string codecs.
* Backport checkin:Walter Dörwald2005-11-281-0/+1
| | | | Fix leaked reference to None.
* Backport: SF bug #1331563 ] string_subscript doesn't check for failed ↵Neal Norwitz2005-10-201-0/+2
| | | | PyMem_Malloc.
* - On 64-bit platforms, when __len__() returns a value that cannot beGuido van Rossum2005-09-202-2/+22
| | | | | represented as a C int, raise OverflowError. (Will forward-port.)