Neal Norwitz
04e39ec815
otherset is known to be non-NULL based on checks before and DECREF after.
...
DECREF otherset rather than XDECREF in error conditions too.
Reported by Klockwork #154 .
2006-07-17 00:57:15 +00:00
Neal Norwitz
b337bb541b
Stop INCREFing name, then checking if it's NULL. name (f_name) should never
...
be NULL so assert it. Fix one place where we could have passed NULL.
Reported by Klocwork #66 .
2006-07-17 00:55:45 +00:00
Neal Norwitz
ee4cc698ca
PyFunction_SetDefaults() is documented as taking None or a tuple.
...
A NULL would crash the PyTuple_Check(). Now make NULL return a SystemError.
Reported by Klocwork #73 .
2006-07-16 02:35:47 +00:00
Neal Norwitz
fc28e0de58
Handle a NULL name properly.
...
Reported by Klocwork #67
2006-07-16 02:32:03 +00:00
Neal Norwitz
4b0a315c31
Use sizeof(buffer) instead of duplicating the constants to ensure they won't
...
be wrong.
The real change is to pass (bufsz - 1) to PyOS_ascii_formatd and 1
to strncat. strncat copies n+1 bytes from src (not dest).
Reported by Klocwork #58 .
2006-07-16 02:22:30 +00:00
Neal Norwitz
ef02b9e144
a & b were dereffed above, so they are known to be valid pointers.
...
z is known to be NULL, nothing to DECREF.
Reported by Klockwork, #107 .
2006-07-16 02:00:32 +00:00
Neal Norwitz
7e49c6eee8
Fix uninitialized memory read reported by Valgrind when running doctest.
...
This could happen if size == 0.
2006-07-12 05:27:46 +00:00
Kristján Valur Jónsson
74c3ea0a0f
Fix build problems with the platform SDK on windows. It is not sufficient to test for the C compiler version when determining if we have the secure CRT from microsoft. Must test with an undocumented macro, __STDC_SECURE_LIB__ too.
2006-07-03 14:59:05 +00:00
Martin v. Löwis
d5cfa5491a
Put method-wrappers into trashcan. Fixes #927248 .
2006-07-03 13:47:40 +00:00
Neal Norwitz
0f415dc57f
Another problem reported by Coverity. Backport candidate.
2006-06-30 07:32:46 +00:00
Neal Norwitz
b114984225
Fix refleak
2006-06-23 03:32:44 +00:00
Armin Rigo
53c1692f6a
Fix for an obscure bug introduced by revs 46806 and 46808, with a test.
...
The problem of checking too eagerly for recursive calls is the
following: if a RuntimeError is caused by recursion, and if code needs
to normalize it immediately (as in the 2nd test), then
PyErr_NormalizeException() needs a call to the RuntimeError class to
instantiate it, and this hits the recursion limit again... causing
PyErr_NormalizeException() to never finish.
Moved this particular recursion check to slot_tp_call(), which is not
involved in instantiating built-in exceptions.
Backport candidate.
2006-06-21 21:58:50 +00:00
Neal Norwitz
0f2783cb4c
Use Py_ssize_t
2006-06-19 05:40:44 +00:00
Georg Brandl
ccff785258
Patch #1507676 : improve exception messages in abstract.c, object.c and typeobject.c.
2006-06-18 22:17:29 +00:00
Martin v. Löwis
d825143be1
Patch #1455898 : Incremental mode for "mbcs" codec.
2006-06-14 05:21:04 +00:00
Brett Cannon
ea3912b0da
If a classic class defined a __coerce__() method that just returned its two
...
arguments in reverse, the interpreter would infinitely recourse trying to get a
coercion that worked. So put in a recursion check after a coercion is made and
the next call to attempt to use the coerced values.
Fixes bug #992017 and closes crashers/coerce.py .
2006-06-13 21:46:41 +00:00
Neal Norwitz
de4c78a1d7
Initialize the type object so pychecker can't crash the interpreter.
2006-06-13 08:28:19 +00:00
Kristján Valur Jónsson
f608317061
Fix the CRT argument error handling for VisualStudio .NET 2005. Install a CRT error handler and disable the assertion for debug builds. This causes CRT to set errno to EINVAL.
...
This update fixes crash cases in the test suite where the default CRT error handler would cause process exit.
2006-06-12 15:45:12 +00:00
Neal Norwitz
b9845e72f9
Get rid of f_restricted too. Doc the other 4 ints that were already removed
...
at the NeedForSpeed sprint.
2006-06-12 02:11:18 +00:00
Neal Norwitz
a00c0b97bf
Don't leak the list object if there's an error allocating the item storage. Backport candidate
2006-06-12 02:08:41 +00:00
Neal Norwitz
7d5b6e8991
f_code can't be NULL based on Frame_New and other code that derefs it.
...
So there doesn't seem to be much point to checking here.
2006-06-11 05:48:14 +00:00
Neal Norwitz
8e6675a7dc
Update doc to make it agree with code.
...
Bottom factor out some common code.
2006-06-11 05:47:14 +00:00
Skip Montanaro
9a8ae8f46b
Suppress warning on MacOSX about possible use before set of proc.
2006-06-10 22:38:13 +00:00
Martin v. Löwis
0e8bd7e1cc
Patch #1495999 : Part two of Windows CE changes.
...
- update header checks, using autoconf
- provide dummies for getenv, environ, and GetVersion
- adjust MSC_VER check in socketmodule.c
2006-06-10 12:23:46 +00:00
Armin Rigo
acd0d6d416
SF bug #1503294 .
...
PyThreadState_GET() complains if the tstate is NULL, but only in debug mode.
2006-06-10 10:57:40 +00:00