2726 Commits

Author SHA1 Message Date
Guido van Rossum
c261e4868b Avoid potential for undefined variable 'startinpos' in PyUnicode_DecodeUTF7().
See issue #5389.
2009-03-05 21:47:33 +00:00
Martin v. Löwis
3c08e45b70 Revert patch for #1706039, as it can crash the interpreter. 2008-12-23 13:10:43 +00:00
Martin v. Löwis
084486b234 Issue #1706039: Support continued reading from a file even after
EOF was hit.
2008-12-13 15:36:49 +00:00
Benjamin Peterson
42fe1a2ff8 backport r67246 from the trunk 2008-11-17 23:35:24 +00:00
Amaury Forgeot d'Arc
b50f9926ca #3967: Correct a crash in count() and find() methods of string-like objects.
For example:
   "".count("xxxx", sys.maxint, 0)

Backport of r66631.
2008-09-26 22:46:01 +00:00
Amaury Forgeot d'Arc
afa0d58a2d Issue #3751: str.rpartition would perform a left-partition when called with
a unicode argument.

Backport of r66119
2008-09-01 20:05:08 +00:00
Georg Brandl
45c33ce62d - Issue #3537: Fix an assertion failure when an empty but presized dict
object was stored in the freelist. (backport from r65637.)
2008-08-11 09:13:26 +00:00
Neal Norwitz
4f3be8a0a9 Security patches from Apple: prevent int overflow when allocating memory 2008-07-31 17:08:14 +00:00
Neal Norwitz
83ac0144fa Backport code from r65182:
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.
2008-07-28 05:06:20 +00:00
Antoine Pitrou
c8e4bed1c5 #2242: utf7 decoding crashes on bogus input on some Windows/MSVC versions 2008-07-25 19:00:48 +00:00
Amaury Forgeot d'Arc
3255e134fe Issue 3110: Crash with weakref subclass,
seen after a "import multiprocessing.reduction"

An instance of a weakref subclass can have attributes.
If such a weakref holds the only strong reference to the object,
deleting the weakref will delete the object. In this case,
the callback must not be called, because the ref object is being deleted!

Backport of r34309
2008-06-16 19:22:42 +00:00
Gregory P. Smith
9e6649f8ee Backport r61468 from trunk: Improves the text of the IOError raised
when open() returns EINVAL.  See issue2158.
2008-05-03 07:12:23 +00:00
Amaury Forgeot d'Arc
0f1653e957 Correct previous checkin, probably a svn merge issue.
Now the code is similar to the one in trunk/.

The behavior was funny:
   >>> print (), repr(())
   (), ()
   >>> print (), repr(())
   (), (...)
2008-04-11 00:33:07 +00:00
Guido van Rossum
aa975432d4 - Issue #1686386: Tuple's tp_repr did not take into account the possibility of
having a self-referential tuple, which is possible from C code.  Nor did
  object's tp_str consider that a type's tp_str could do something that could
  lead to an inifinite recursion.  Py_ReprEnter() and Py_EnterRecursiveCall(),
  respectively, fixed the issues.  (Backport of r58288 from trunk to 2.5.)
2008-04-10 22:43:58 +00:00
Gregory P. Smith
a6add69a63 backport r62271 from trunk.
remove the now obsoleted assertion.
2008-04-10 19:54:13 +00:00
Gregory P. Smith
14acde30f6 Backport r62261 from trunk:
Prevent PyString_FromStringAndSize() from passing negative sizes on to lower
level memory allocation functions.  Raise a SystemError and return NULL
instead.
2008-04-09 23:41:13 +00:00
Amaury Forgeot d'Arc
a79e05097b #1477: ur'\U0010FFFF' used to raise in narrow unicode builds.
Corrected the raw-unicode-escape codec to use UTF-16 surrogates in
this case, like the unicode-escape codec does.

Backport of r61793 and r61853
2008-03-24 21:16:28 +00:00
Neal Norwitz
b3635f99a2 Backport r61458:
Issue 2321: reduce memory usage (increase the memory that is returned
to the system) by using pymalloc for the data of unicode objects.
2008-03-18 04:17:36 +00:00
Guido van Rossum
44a93e54f4 Fix the overflows in expandtabs(). "This time for sure!"
(Exploit at request.)
2008-03-11 21:14:54 +00:00
Martin v. Löwis
73c01d4101 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.
2008-02-14 11:26:18 +00:00
Thomas Wouters
6bf585e753 Fix typo in constant name. 2008-01-25 21:08:41 +00:00
Thomas Wouters
d92272e4a9 Use the right (portable) definition of the max of a Py_ssize_t. 2008-01-25 19:51:24 +00:00
Guido van Rossum
ee6bab06d3 Rewrite the list_inline_repeat overflow check slightly differently. 2008-01-25 19:42:36 +00:00
Guido van Rossum
1859f5b4d2 Backport r60246.
Fix issue #1303614, test67.py.
2008-01-24 17:59:56 +00:00
Guido van Rossum
03706d2db0 Backport r55080:
Fix for #1303614 and #1174712:
- __dict__ descriptor abuse for subclasses of built-in types
- subclassing from both ModuleType and another built-in types
2008-01-18 21:31:32 +00:00