summaryrefslogtreecommitdiffstats
path: root/Modules
Commit message (Collapse)AuthorAgeFilesLines
* #4317: Fix an Array Bounds Read in imageop.rgb2rgb8.Amaury Forgeot d'Arc2008-11-181-1/+1
| | | | Backport of r67266
* - Security Issue #2: imageop did not validate arguments correctly and couldMatthias Klose2008-11-121-160/+109
| | | | | | segfault as a result. CVE-2008-4864. backport r66689
* - Issue #2586: Fix CVE-2008-1721, zlib crash fromMatthias Klose2008-11-121-0/+4
| | | | zlib.decompressobj().flush(val) when val is not positive.
* - Issue #1179: Fix CVE-2007-4965 and CVE-2008-1679, multiple integerMatthias Klose2008-11-122-12/+73
| | | | overflows in the imageop and rgbimgmodule modules.
* Security patches from Apple: prevent int overflow when allocating memoryNeal Norwitz2008-07-313-2/+22
|
* Backport r65182. This change modified from using the unsigned max valueNeal Norwitz2008-07-283-4/+10
| | | | | | | | | | | to the signed max value similar to 2.5 and trunk. Issue #2620: Overflow checking when allocating or reallocating memory was not always being done properly in some python types and extension modules. PyMem_MALLOC, PyMem_REALLOC, PyMem_NEW and PyMem_RESIZE have all been updated to perform better checks and places in the code that would previously leak memory on the error path when such an allocation failed have been fixed.
* Backport of r60793:Martin v. Löwis2008-03-0210-27/+220
| | | | | | 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.
* Revert the following revisions, as they don't fix securityMartin v. Löwis2008-03-021-5/+1
| | | | | | | 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
* (Backport from r55770)Hye-Shik Chang2007-06-051-1/+5
| | | | | | Bug #1728403: Fix a bug that CJKCodecs StreamReader hangs when it reads a file that ends with incomplete sequence and sizehint argument for .read() is specified.
* Backport 50567Anthony Baxter2006-10-102-17/+72
| | | | | | #1494314: Fix a regression with high-numbered sockets in 2.4.3. This means that select() on sockets > FD_SETSIZE (typically 1024) work again. The patch makes sockets use poll() internally where available.
* Backport r45505, r45573, r45576Martin v. Löwis2006-10-091-6/+7
| | | | | | | | | | | | | | | | | | - reset errno before calling confstr - use confstr() doc to simplify checks afterwards - Correct implementation and documentation of os.confstr. Add a simple test case. I've yet to figure out how to provoke a None return I can test. - Address issues brought up by MvL on python-checkins. I tested this with valgrind on amd64. The man pages I found for diff architectures are inconsistent on this. I'm not entirely sure this change is correct for all architectures either. Perhaps we should just over-allocate and not worry about it? The change to return None instead of "" in case of unconfigured values has not been backported.
* [Partial backport of r45947 | neal.norwitz]Andrew M. Kuchling2006-10-092-3/+5
| | | | | | | | | | Fix problems found by Coverity. _ssl.c: under fail: self is DECREF'd, but it would have been NULL. _csv.c: I'm not sure if lineterminator could have been anything other than a string. However, other string method calls are checked, so check this one too.
* Port of universal binary support for Mac OSX from python 2.5. This takes awayRonald Oussoren2006-10-084-7/+124
| | | | | | | | 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.
* Backport from trunk r52223:Hye-Shik Chang2006-10-081-14/+22
| | | | | Bug #1572832: fix a bug in ISO-2022 codecs which may cause segfault when encoding non-BMP unicode characters. (Submitted by Ray Chason)
* [Backport r50783 | neal.norwitz. The bytes_left code is complicated,Andrew M. Kuchling2006-10-051-10/+19
| | | | | | | | | | | | | 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.
* [Partial backport of r51218 | neal.norwitz -- the changes to ast.c, symtable.c,Andrew M. Kuchling2006-10-052-1/+6
| | | | | | | | | 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).
* [Partial backport of r50773 | neal.norwitz -- other parts of this patchAndrew M. Kuchling2006-10-052-12/+29
| | | | | | applied to pyarena.c, compile.c, and symtable.c, which were different in 2.4.] Fix more memory allocation issues found with failmalloc.
* [Backport r52147 | andrew.kuchling]Andrew M. Kuchling2006-10-051-2/+21
| | | | | | 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.
* [Backport r51223 | neal.norwitz]Andrew M. Kuchling2006-10-051-0/+2
| | | | | | | | 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
* [Backport r51224 | neal.norwitz]Andrew M. Kuchling2006-10-051-1/+1
| | | | | Move the assert which checks for a NULL pointer first. Klocwork #274.
* [Backport r51255 | neal.norwitz]Andrew M. Kuchling2006-10-051-0/+1
| | | | | Really address the issue of where to place the assert for leftblock. (Followup of Klocwork 274)
* [Backport r51225 | neal.norwitz]Andrew M. Kuchling2006-10-041-0/+3
| | | | | | | | | | | 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]
* [Backport r51232 | neal.norwitz]Andrew M. Kuchling2006-10-041-4/+13
| | | | | | | 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)
* [Backport r51251 | neal.norwitz]Andrew M. Kuchling2006-10-041-2/+8
| | | | | | Handle malloc and fopen failures more gracefully. Klocwork 180-181
* [Backport r51226 | neal.norwitz]Andrew M. Kuchling2006-10-041-2/+11
| | | | | | | | 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
* Compilation problem caused by conflicting typedefs for uint32_tArmin Rigo2006-10-042-0/+4
| | | | (unsigned long vs. unsigned int).
* [Backport r51252 | neal.norwitz]Andrew M. Kuchling2006-10-031-0/+3
| | | | | | | | 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
* [backport r51253 | neal.norwitz]Andrew M. Kuchling2006-10-031-0/+4
| | | | | | Handle failures from lookup. Klocwork 341-342
* [Backport r51033 | neal.norwitz]Andrew M. Kuchling2006-10-031-1/+1
| | | | | | Prevent memory leak on error. Reported by Klocwork #36
* [Backport r50858 | neal.norwitz]Andrew M. Kuchling2006-10-031-2/+9
| | | | | | No functional change. Add comment and assert to describe why there cannot be overflow which was reported by Klocwork. Discussed on python-dev.
* [Backport r50782 | neal.norwitz]Andrew M. Kuchling2006-10-031-2/+8
| | | | | | | nextlink can be NULL if teedataobject_new fails, so use XINCREF. Ensure that dataobj is never NULL. Reported by Klocwork #102
* [Backport r51229 | neal.norwitz]Andrew M. Kuchling2006-10-031-2/+4
| | | | | | Don't deref v if it's NULL. Klocwork #214
* [Backport r50781 | neal.norwitz]Andrew M. Kuchling2006-10-031-2/+2
| | | | Fix memory leaks spotted by Klocwork #37.
* [Backport r50677 | neal.norwitz]Andrew M. Kuchling2006-10-031-9/+11
| | | | | | Fix memory leaks in some conditions. Reported by Klocwork #152.
* [Backport rev. 47010 by neal.norwitz]Andrew M. Kuchling2006-10-031-0/+2
| | | | Fix memory leak reported by valgrind while running test_subprocess
* Bug #1556784: allow format strings longer than 127 characters inGeorg Brandl2006-09-301-2/+2
| | | | | datetime's strftime function. (backport from rev. 52072)
* [Backport rev 39653 by nnorwitz]Andrew M. Kuchling2006-09-291-0/+4
| | | | | | | | | | SF Bug # 941346, AIX shared library fix Since I can't test this, I'm just adding a comment. If we get access to AIX boxes, we can test this and really resolve. Anyone from IBM want to offer help? Backport candidate I suppose.
* [Backport rev. 39135 by mwh]Andrew M. Kuchling2006-09-281-0/+2
| | | | | | | | | | | | | | | | | | Fix bug [ 1232517 ] OverflowError in time.utime() causes strange traceback A needed error check was missing. (Actually, this error check may only have become necessary in fairly recent Python, not sure). Backport candidate. [A few lines below the code in 2.4 touched by the patch, there's already a similar check of (intval == -1 && PyErr_Occurred()), so I think this function can already report such errors, and therefore the fix still applies. Perhaps Michael can clarify what he was referring to. --amk]
* [Backport rev.39030 by nascheme]Andrew M. Kuchling2006-09-281-0/+1
| | | | Add missing INCREF.
* [Backport rev. 39012 by mwh]Andrew M. Kuchling2006-09-281-0/+1
| | | | Add a missing incref.
* [Backport of rev. 42093 by neal.norwitz]Andrew M. Kuchling2006-09-2767-0/+133
| | | | | | Check return result from Py_InitModule*(). This API can fail. Probably should be backported.
* [Backport of rev. 51683 by neal.norwitz]Andrew M. Kuchling2006-09-271-0/+4
| | | | | Bug #1548092: fix curses.tparm seg fault on invalid input. Needs backport to 2.5.1 and earlier.
* [Backport rev.51254 from neal.norwitz]Andrew M. Kuchling2006-09-271-9/+15
| | | | | | | Handle failure from PyModule_GetDict() (Klocwork 208). Fix a bunch of refleaks in the init of the module. This would only be found when running python -v.
* fix a bug with bsddb.DB.stat reversing its flags and txn keywordGregory P. Smith2006-09-191-1/+1
| | | | arguments. (reported by Louis Zechtzer)
* Backport from trunk r51737:Hye-Shik Chang2006-09-073-28/+39
| | | | | | | | | Fixed a few bugs on cjkcodecs: - gbk and gb18030 codec now handle U+30FB KATAKANA MIDDLE DOT correctly. - iso2022_jp_2 codec now encodes into G0 for KS X 1001, GB2312 codepoints to conform the standard. - iso2022_jp_3 and iso2022_jp_2004 codec can encode JIS X 0213:2 codepoints now.
* Bug #1551427: fix a wrong NULL pointer check in the win32 versionGeorg Brandl2006-09-061-1/+1
| | | | | of os.urandom(). (backport from rev. 51762)
* Backport trunk's revision 51565:Thomas Wouters2006-08-241-1/+1
| | | | | | Fix SF bug #1545837: array.array borks on deepcopy. array.__deepcopy__() needs to take an argument, even if it doesn't actually use it. Will backport to 2.5 and 2.4 (if applicable.)
* Patch #1540329: _hotshot.c fix backports.Georg Brandl2006-08-191-3/+8
|
* Patch #1535500: fix segfault in BZ2File.writelines and make sure itGeorg Brandl2006-08-141-3/+17
| | | | | raises the correct exceptions. (backport from rev. 51285)
* Backport a patch applied to trunk that allows Python to compile withMatt Fleming2006-08-131-0/+8
| | | | NetBSD's bluetooth API.