41 Commits

Author SHA1 Message Date
Neal Norwitz
4f3be8a0a9 Security patches from Apple: prevent int overflow when allocating memory 2008-07-31 17:08:14 +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
Martin v. Löwis
897704d1dd Bug #1733488: Fix compilation of bufferobject.c on AIX. 2007-06-08 17:29:40 +00:00
Thomas Heller
ab1049c046 memcmp() can return values other than -1, 0, and +1 but tp_compare
must not.
2006-08-08 17:37:00 +00:00
Skip Montanaro
9a8ae8f46b Suppress warning on MacOSX about possible use before set of proc. 2006-06-10 22:38:13 +00:00
Brett Cannon
c48b0e6657 Fix inconsistency in naming within an enum. 2006-06-09 17:05:48 +00:00
Brett Cannon
de3b052216 Buffer objects would return the read or write buffer for a wrapped object when
the char buffer was requested.  Now it actually returns the char buffer if
available or raises a TypeError if it isn't (as is raised for the other buffer
types if they are not present but requested).

Not a backport candidate since it does change semantics of the buffer object
(although it could be argued this is enough of a bug to bother backporting).
2006-06-08 17:00:45 +00:00
Anthony Baxter
377be11ee1 More C++-compliance. Note especially listobject.c - to get C++ to accept the
PyTypeObject structures, I had to make prototypes for the functions, and
move the structure definition ahead of the functions. I'd dearly like a better
way to do this - to change this would make for a massive set of changes to
the codebase.

There's still some warnings - this is purely to get rid of errors first.
2006-04-11 06:54:30 +00:00
Thomas Wouters
02cbdd3461 Use proper PyArg_Parse format char for Py_ssize_t, instead of 'l', in
buffer_new(). Probably fixes a bug in 'buffer("", 10, 10)' on platforms
where sizeof(Py_ssize_t) != sizeof(long) (Win64?)
2006-02-16 19:44:46 +00:00
Martin v. Löwis
e0e89f7920 Revert 42400. 2006-02-16 06:59:22 +00:00
Martin v. Löwis
2c95cc6d72 Support %zd in PyErr_Format and PyString_FromFormat. 2006-02-16 06:54:25 +00:00
Neal Norwitz
26efe402c2 Get rid of compiler warnings (gcc 3.3.4 on x86) 2006-02-16 06:21:57 +00:00
Martin v. Löwis
18e165558b Merge ssize_t branch. 2006-02-15 17:27:45 +00:00
Neal Norwitz
7c460740ed Check return result for error 2005-12-18 08:02:38 +00:00
Georg Brandl
02c42871cf Disallow keyword arguments for type constructors that don't use them.
(fixes bug #1119418)
2005-08-26 06:42:30 +00:00
Neil Schemenauer
927a57fbeb Ensure negative offsets cannot be passed to buffer(). When composing
buffers, compute the new buffer size based on the old buffer size.
Fixes SF bug #1034242.
2004-09-24 19:17:26 +00:00
Neil Schemenauer
fb6ba07d9c Fix buffer offset calculation (need to compute it before changing
'base').  Fixes SF bug #1033720.  Move offset sanity checking to
buffer_from_memory().
2004-09-24 15:41:27 +00:00
Martin v. Löwis
093c100bd4 Correct code to advance ptr to be well-formed C. 2004-03-25 16:16:28 +00:00
Neil Schemenauer
4252a7a5d1 Make buffer objects based on mutable objects (like array) safe. 2004-03-11 02:42:45 +00:00
Neil Schemenauer
0eadcd9cbb Document one of the many problems with the buffer object. 2004-03-11 01:00:44 +00:00
Neil Schemenauer
5e3a675b6d Rename static functions, they should not have the _Py prefix. 2004-03-11 00:44:54 +00:00
Guido van Rossum
e3a8e7ed1d Call me anal, but there was a particular phrase that was speading to
comments everywhere that bugged me: /* Foo is inlined */ instead of
/* Inline Foo */.  Somehow the "is inlined" phrase always confused me
for half a second (thinking, "No it isn't" until I added the missing
"here").  The new phrase is hopefully unambiguous.
2002-08-19 19:26:42 +00:00
Raymond Hettinger
5a04aec384 Fix SF bug 546434 -- buffer slice type inconsistent. 2002-06-25 00:25:30 +00:00
Guido van Rossum
bea18ccde6 SF patch 568629 by Oren Tirosh: types made callable.
These built-in functions are replaced by their (now callable) type:

    slice()
    buffer()

and these types can also be called (but have no built-in named
function named after them)

    classobj (type name used to be "class")
    code
    function
    instance
    instancemethod (type name used to be "instance method")

The module "new" has been replaced with a small backward compatibility
placeholder in Python.

A large portion of the patch simply removes the new module from
various platform-specific build recipes.  The following binary Mac
project files still have references to it:

    Mac/Build/PythonCore.mcp
    Mac/Build/PythonStandSmall.mcp
    Mac/Build/PythonStandalone.mcp

[I've tweaked the code layout and the doc strings here and there, and
added a comment to types.py about StringTypes vs. basestring.  --Guido]
2002-06-14 20:41:17 +00:00
Tim Peters
1f7df3595a Remove the CACHE_HASH and INTERN_STRINGS preprocessor symbols. 2002-03-29 03:29:08 +00:00