236 Commits

Author SHA1 Message Date
Martin v. Löwis
c8ed4ff565 Backport of r60793:
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-03-02 19:20:32 +00:00
Andrew M. Kuchling
5e27a6cb0b [Backport r46602 | neal.norwitz]
Patch #1357836:

Prevent an invalid memory read from test_coding in case the done flag is set.
In that case, the loop isn't entered.  I wonder if rather than setting
the done flag in the cases before the loop, if they should just exit early.

This code looks like it should be refactored.

Backport candidate (also the early break above if decoding_fgets fails)
2006-10-06 18:59:10 +00:00
Andrew M. Kuchling
20cc6be1aa [Backport r51222 | neal.norwitz -- if you hack the code to set r=NULL,
you find that Python does print "MemoryError".  There's no traceback
 and no indication of which line of code is responsible, but it's
 better than a segfault.]

Handle NULL nodes while parsing.  I'm not entirely sure this is correct.
There might be something else that needs to be done to setup the error.

Klocwork #295.
2006-10-05 19:32:52 +00:00
Andrew M. Kuchling
0370431990 [Backport r51256 | neal.norwitz]
Handle malloc failure.

Klocwork 281
2006-10-03 18:34:29 +00:00
Andrew M. Kuchling
100e7d77f2 [Backport rev39767 by nnorwitz]
Free coding spec (cs) if there was an error to prevent mem leak.
Maybe backport candidate.

[Bugfix seems applicable to 2.4 to me. --amk]
2006-09-29 17:42:30 +00:00
Anthony Baxter
022a55c0d9 update - still some old .cvsignore files lying around 2006-03-23 02:26:07 +00:00
Hye-Shik Chang
361cd4bd6c Backport r42894: SF #1444030 Fix several potential defects found
by Coverity.
2006-03-07 15:59:09 +00:00
Neal Norwitz
5f5124e410 Backport 41753:
Bug #1378022, UTF-8 files with a leading BOM crashed the interpreter.
  Also bug #1435487 (dup).
2006-02-21 09:19:45 +00:00
Walter Dörwald
a6f561447a Backport checkin:
Apply SF patch #1101726: Fix buffer overrun in tokenizer.c when a source file
with a PEP 263 encoding declaration results in long decoded line.
2005-07-12 21:58:38 +00:00
Michael W. Hudson
52cba65d1a Backport my recent raw_input() vs no threads build vs SIGINT argh:
In a threads-disabled build, typing Ctrl-C into a raw_input() crashed,
because (essentially) I didn't realise that PY_BEGIN/END_ALLOW_THREADS
actually expanded to nothing under a no-threads build, so if you somehow
NULLed out the threadstate (e.g. by calling PyThread_SaveThread) it would
stay NULLed when you return to Python.  Argh!
2005-04-07 10:19:47 +00:00
Anthony Baxter
9ceaa72ebe Patch #975056 - fixes for restartable signals on *BSD. In addition,
a few remaining calls to signal() were converted to PyOS_setsig().
2004-10-13 14:48:50 +00:00
Hye-Shik Chang
7df44b384a SF #941229: Decode source code with sys.stdin.encoding in interactive
modes like non-interactive modes.  This allows for non-latin-1 users
to write unicode strings directly and sets Japanese users free from
weird manual escaping <wink> in shift_jis environments.
(Reviewed by Martin v. Loewis)
2004-08-04 17:36:41 +00:00
Anthony Baxter
c2a5a63654 PEP-0318, @decorator-style. In Guido's words:
"@ seems the syntax that everybody can hate equally"
Implementation by Mark Russell, from SF #979728.
2004-08-02 06:10:11 +00:00
Michael W. Hudson
2384990603 PyThreadState_Swap(NULL) didn't do what I thought it did. Fixes
[ 987287 ] Python 2.4a1, interpreter hanging on Keyboard Interrupt
2004-07-08 15:28:26 +00:00
Neal Norwitz
4ded4b52c4 Pass the flags along, rather than ignoring them. Backport candidate 2004-07-08 01:54:07 +00:00
Tim Peters
b7e898a0e2 "#if WITH_THREAD" is incorrect; must be #ifdef instead; WITH_THREAD
isn't always set to an integer value when it's defined.
2004-07-07 20:42:07 +00:00
Michael W. Hudson
30ea2f223f This closes patch:
[ 960406 ] unblock signals in threads

although the changes do not correspond exactly to any patch attached to
that report.

Non-main threads no longer have all signals masked.

A different interface to readline is used.

The handling of signals inside calls to PyOS_Readline is now rather
different.

These changes are all a bit scary!  Review and cross-platform testing
much appreciated.
2004-07-07 17:44:12 +00:00
Andrew M. Kuchling
93b4b88e96 [Patch #974633] Check PyObject_MALLOC return for error 2004-06-29 14:03:04 +00:00
Guido van Rossum
c69661725a Fix for SF 780407.
Change %08l to %p to print a pointer.
Will backport to 2.3.
2004-03-20 22:34:14 +00:00
Skip Montanaro
db6080507d Remove support for --without-universal-newlines (see PEP 11). 2004-02-07 13:53:46 +00:00
Guido van Rossum
bd311d8e4e Remove a "temporary" piece of code that was probably unneeded since
mid 1990.  Remove an untrue XXX comment.
2003-12-15 06:06:24 +00:00
Jack Jansen
6402357d40 Talk about old code: removed a reference to THINK_C. 2003-11-20 13:33:48 +00:00
Jack Jansen
eddc1449ba Getting rid of all the code inside #ifdef macintosh too. 2003-11-20 01:44:59 +00:00
Jack Jansen
fb2765666f Getting rid of support for the ancient Apple MPW compiler. 2003-11-19 15:24:47 +00:00
Tim Peters
8ab2ec432a SF bug 751956: graminit.[ch] don't build on windows
A change from Duncan Booth, to deal with changes in the way pgen gets
built.  Note that graminit.[ch] aren't normally built on Windows (they're
obtained from CVS).
2003-06-17 00:05:53 +00:00