summaryrefslogtreecommitdiff
path: root/Python/marshal.c
Commit message (Collapse)AuthorAgeFilesLines
* fix marshal uninitialized variable warnings (#4114)Benjamin Peterson2017-10-241-0/+6
| | | | | | | | | | | | | | | | | GCC says: ../cpython/Python/marshal.c: In function ‘PyMarshal_WriteLongToFile’: ../cpython/Python/marshal.c:70:35: warning: ‘wf.ptr’ may be used uninitialized in this function [-Wmaybe-uninitialized] else if ((p)->ptr != (p)->end) *(p)->ptr++ = (c); \ ^~ ../cpython/Python/marshal.c:70:47: warning: ‘wf.end’ may be used uninitialized in this function [-Wmaybe-uninitialized] else if ((p)->ptr != (p)->end) *(p)->ptr++ = (c); \ ^~ ../cpython/Python/marshal.c:77:10: warning: ‘wf.str’ may be used uninitialized in this function [-Wmaybe-uninitialized] if (p->str == NULL) ~^~~~~ This isn't a real problem because if the file pointer is not NULL, the string-related fields are never touched. But, it doesn't hurt to set the unused fields to NULL.
* reduce marshal stack size in debug mode on windows (closes #27019)Benjamin Peterson2016-07-061-0/+5
|
* Fix reference leaks introduced by the patch for issue #5308.Serhiy Storchaka2013-07-111-9/+11
|
* Issue #5308: Raise ValueError when marshalling too large object (a sequenceSerhiy Storchaka2013-02-131-56/+56
| | | | with size >= 2**31), instead of producing illegal marshal data.
* Untabify C files. Will watch buildbots.Antoine Pitrou2010-05-091-1089/+1089
|
* Issue #7332: Remove the 16KB stack-based buffer inAntoine Pitrou2010-04-211-16/+4
| | | | | | PyMarshal_ReadLastObjectFromFile, which doesn't bring any noticeable benefit compared to the dynamic memory allocation fallback. Patch by Charles-François Natali.
* more _PyString_Resize error checkingBenjamin Peterson2010-04-031-1/+2
|
* Set retval on PyOS_string_to_double failure.Mark Dickinson2009-10-311-3/+9
|
* Removed PyOS_ascii_atof from marshal.c, as mentioned in issue 7117. Also ↵Eric Smith2009-10-271-11/+9
| | | | brings it more in line with py3k.
* Removed calls to PyFloat_AsReprString.Eric Smith2009-10-191-42/+63
| | | | | | | | | This is in anticipation of possibly implementing issue 7117 (short float repr). This removes the last calls to PyFloat_AsString, PyFloat_AsReprString, and PyFloat_AsStringEx, which are unsafe. Also, switch to defines for error values to bring this code more in line with the py3k branch.
* Issue #7019: Unmarshalling of bad long data could produce unnormalizedMark Dickinson2009-09-291-3/+13
| | | | PyLongs. Raise ValueError instead.
* Move news item to correct section, remove spurious 'see below'R. David Murray2009-05-131-1/+1
| | | | from docstring.
* Issue 5994: add docstrings to marshal.R. David Murray2009-05-131-5/+81
|
* Issue #4258: Use 30-bit digits for Python longs, on 64-bit platforms.Mark Dickinson2009-03-201-39/+105
| | | | Backport of r70459.
* Make marshalling errors a little more informative as to what went wrongNick Coghlan2009-03-151-13/+13
|
* Issue 3116: fix quadratic behavior in marshal.dumps().Raymond Hettinger2008-06-161-1/+1
|
* This reverts r63675 based on the discussion in this thread:Gregory P. Smith2008-06-091-18/+18
| | | | | | | http://mail.python.org/pipermail/python-dev/2008-June/079988.html Python 2.6 should stick with PyString_* in its codebase. The PyBytes_* names in the spirit of 3.0 are available via a #define only. See the email thread.
* Renamed PyString to PyBytesChristian Heimes2008-05-261-18/+18
|
* #1792: Improve performance of marshal.dumps() on large objects by increasingAndrew M. Kuchling2008-05-111-1/+4
| | | | the size of the buffer more quickly.
* Fix refleakNeal Norwitz2008-02-011-0/+1
|
* Removed unused varChristian Heimes2008-01-301-1/+1
|
* Removed unnecessary conditional (spotted by Neal Norwitz).Raymond Hettinger2008-01-281-1/+1
|
* Let marshal built-up sets and frozensets one element at a time (without ↵Raymond Hettinger2008-01-281-12/+8
| | | | creating an intermediate tuple).
* Revert PySet_Add() changes.Raymond Hettinger2008-01-261-8/+12
|
* Let marshal build-up sets and frozensets one element at a time.Raymond Hettinger2008-01-261-12/+8
| | | | Saves the unnecessary creation of a tuple as intermediate container.
* Fix marshal's incorrect handling of subclasses of builtin types (backport ↵Raymond Hettinger2007-11-071-10/+10
| | | | candidate).
* Fix Coverity 185-186: If the passed in FILE is NULL, uninitialized memoryNeal Norwitz2007-10-121-0/+2
| | | | | | would be accessed. Will backport.
* Last try for tweaking the max stack depth. 5000 was the original value,Neal Norwitz2007-05-171-1/+1
| | | | | 4000 didn't work either. 1000 does work on Windows. If 2000 works, that will hopefully be a reasonable balance.
* Set the depth to something very small to try to determine if theNeal Norwitz2007-05-171-1/+1
| | | | | crashes on Windows are really due to the stack size or possibly some other problem.
* Reduce the max stack depth to see if this fixes the segfaults onNeal Norwitz2007-05-171-1/+1
| | | | | Windows and some other boxes. If this is successful, this rev should be backported. I'm not sure how close to the limit we should push this.
* Fix bug in marshal where bad data would cause a segfault due toNeal Norwitz2007-05-161-69/+156
| | | | | | lack of an infinite recursion check. Contributed by Damien Miller at Google.
* Forward-port of r52136,52138: a review of overflow-detecting code.Armin Rigo2006-10-041-13/+25
| | | | | | | | | | | | | | | | | | | | | | | * 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. * 2.5 specific: fixed a number of places that were still confusing int and Py_ssize_t. Some of them could potentially have caused "real-world" breakage. * list.pop(x): fixing overflow issues on x was messy. I just reverted to PyArg_ParseTuple("n"), which does the right thing. (An obscure test was trying to give a Decimal to list.pop()... doesn't make sense any more IMHO) * trying to write a few tests...
* This code is actually not used unless WITHOUT_COMPLEX is defined.Neal Norwitz2006-08-121-0/+8
| | | | | | | | 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.
* Convert more modules to METH_VARARGS.Georg Brandl2006-05-291-5/+3
|
* Change int to Py_ssize_t in several places.Martin v. Löwis2006-03-071-10/+26
| | | | | Add (int) casts to silence compiler warnings. Raise Python exceptions for overflows.
* Make Py_ssize_t clean.Thomas Wouters2006-03-011-1/+3
|
* Fix incompatible assignment warning from previous checkin.Thomas Wouters2006-03-011-1/+2
|
* Fix gcc (4.0.x) warning about use of uninitialized variables.Thomas Wouters2006-03-011-1/+2
| | | | | (PyMarshal_ReadShortFromFile() is only used in zipimport.c, I don't believe the extra initializations will matter one way or another.)
* Move cast to suppress warning.Martin v. Löwis2006-02-161-2/+2
|
* Merge ssize_t branch.Martin v. Löwis2006-02-151-11/+15
|
* Check return result from Py_InitModule*(). This API can fail.Neal Norwitz2006-01-191-0/+2
| | | | Probably should be backported.
* version was not initialized properlyNeal Norwitz2005-11-161-0/+1
|
* Fix a bunch of imports to use code.h instead of compile.h.Jeremy Hylton2005-10-211-1/+0
| | | | Remove duplicate declarations from compile.h
* Merge ast-branch to headJeremy Hylton2005-10-201-0/+1
| | | | | | | | | | This change implements a new bytecode compiler, based on a transformation of the parse tree to an abstract syntax defined in Parser/Python.asdl. The compiler implementation is not complete, but it is in stable enough shape to run the entire test suite excepting two disabled tests.
* Add a C API for sets and frozensets.Raymond Hettinger2005-08-161-4/+2
|
* Fix signedness of various char variables to stop causing a warning under gcc 4.Brett Cannon2005-06-251-10/+10
|
* Fix bugMichael W. Hudson2005-06-131-0/+4
| | | | | | | | [ 1180997 ] lax error-checking in new-in-2.4 marshal stuff which I'd assigned to Martin, but actually turned out to be easy to fix. Also, a test.
* Remove extraneous format character from PyArg_ParseTuple call inMichael W. Hudson2005-06-131-1/+1
| | | | | | marshal_loads. Bugfix candidate.
* Fix a couple of crashing-on-malformed data marshal bugs.Michael W. Hudson2005-06-031-6/+8
|
* This is my patch:Michael W. Hudson2005-06-031-65/+175
| | | | | | | | | [ 1180995 ] binary formats for marshalling floats Adds 2 new type codes for marshal (binary floats and binary complexes), a new marshal version (2), updates MAGIC and fiddles the de-serializing of code objects to be less likely to clobber the real reason for failing if it fails.