Benjamin Peterson
1e211ff10d
it suffices to check for PY_SSIZE_T_MAX overflow ( #22643 )
12 years ago
Benjamin Peterson
c0e64f5027
make sure length is unsigned
12 years ago
Benjamin Peterson
e1bd38c03c
fix integer overflow in unicode case operations ( closes #22643 )
12 years ago
Georg Brandl
ff3e5e3779
Fix unicode_aswidechar() for 4b unicode and 2b wchar_t (AIX).
12 years ago
Benjamin Peterson
736b8012b4
prevent overflow in unicode_repr ( closes #22520 )
12 years ago
Benjamin Peterson
a1c1be4e03
cleanup overflowing handling in unicode_decode_call_errorhandler and unicode_encode_ucs1 ( closes #22518 )
12 years ago
Kristján Valur Jónsson
25dded041f
Make the various iterators' "setstate" sliently and consistently clip the
index. This avoids the possibility of setting an iterator to an invalid
state.
12 years ago
Serhiy Storchaka
94ee389308
Issue #19619 : Blacklist non-text codecs in method API
str.encode, bytes.decode and bytearray.decode now use an
internal API to throw LookupError for known non-text encodings,
rather than attempting the encoding or decoding operation and
then throwing a TypeError for an unexpected output type.
The latter mechanism remains in place for third party non-text
encodings.
Backported changeset d68df99d7a57.
12 years ago
Benjamin Peterson
9743b2c2b5
give non-iterable TypeError a message ( closes #20507 )
12 years ago
Serhiy Storchaka
505ff755d7
Issue #20437 : Fixed 21 potential bugs when deleting objects references.
12 years ago
Serhiy Storchaka
016a3f33a5
Issue #20538 : UTF-7 incremental decoder produced inconsistant string when
input was truncated in BASE64 section.
12 years ago
Serhiy Storchaka
35804e4c63
Issue #19279 : UTF-7 decoder no more produces illegal strings.
13 years ago
Raymond Hettinger
e56666d17f
Silence compiler warning about an uninitialized variable
13 years ago
Christian Heimes
26532f7519
Check return value of PyType_Ready(&EncodingMapType)
CID 486654
13 years ago
Serhiy Storchaka
8eeae2126c
Issue #18184 : PyUnicode_FromFormat() and PyUnicode_FromFormatV() now raise
OverflowError when an argument of %c format is out of range.
13 years ago
Benjamin Peterson
7e30373126
remove MAX_MAXCHAR because it's unsafe for computing maximum codepoitn value (see #18183 )
13 years ago
Antoine Pitrou
8b0e98426d
Issue #17237 : Fix crash in the ASCII decoder on m68k.
13 years ago
Benjamin Peterson
da2c7ebd23
allow any type with __getitem__ to be a mapping for the purposes of % ( #15801 )
13 years ago
Raymond Hettinger
378170d5d9
Issue 17447: Clarify that str.isidentifier doesn't check for reserved keywords.
13 years ago
Victor Stinner
2cb16aa3cb
_PyUnicode_Writer() now also reuses Unicode singletons:
empty string and latin1 single character
13 years ago
Victor Stinner
d21b58c05d
Issue #17223 : Fix PyUnicode_FromUnicode() for string of 1 character outside
the range U+0000-U+10ffff.
13 years ago
Victor Stinner
bbbac2ec34
Issue #17137 : When an Unicode string is resized, the internal wide character
string (wstr) format is now cleared.
13 years ago
Serhiy Storchaka
3fd4ab356d
Issue #17043 : The unicode-internal decoder no longer read past the end of
input buffer.
13 years ago
Serhiy Storchaka
d5327d95d2
Issue #17043 : The unicode-internal decoder no longer read past the end of
input buffer.
13 years ago
Serhiy Storchaka
afb1cb5579
Issue #16971 : Fix a refleak in the charmap decoder.
13 years ago
Serhiy Storchaka
d679377be7
Issue #16979 : Fix error handling bugs in the unicode-escape-decode decoder.
13 years ago
Serhiy Storchaka
c8e58126a2
Issue #16979 : Fix error handling bugs in the unicode-escape-decode decoder.
13 years ago
Serhiy Storchaka
059972535f
Issue #10156 : In the interpreter's initialization phase, unicode globals
are now initialized dynamically as needed.
13 years ago
Serhiy Storchaka
c59c85c1ac
Issue #10156 : In the interpreter's initialization phase, unicode globals
are now initialized dynamically as needed.
13 years ago
Serhiy Storchaka
73e38809e0
Issue #16980 : Fix processing of escaped non-ascii bytes in the
unicode-escape-decode decoder.
13 years ago
Serhiy Storchaka
1d3acd4b59
Issue #16335 : Fix integer overflow in unicode-escape decoder.
13 years ago
Serhiy Storchaka
4f5f0e54e0
Issue #16335 : Fix integer overflow in unicode-escape decoder.
13 years ago
Serhiy Storchaka
74f49ab28b
Issue #15989 : Fix several occurrences of integer overflow
when result of PyInt_AsLong() or PyLong_AsLong() narrowed
to int without checks.
This is a backport of changesets 13e2e44db99d and 525407d89277.
13 years ago
Serhiy Storchaka
441d30fac7
Issue #15989 : Fix several occurrences of integer overflow
when result of PyLong_AsLong() narrowed to int without checks.
This is a backport of changesets 13e2e44db99d and 525407d89277.
13 years ago
Serhiy Storchaka
4fb8caee87
Issue #14850 : Now a chamap decoder treates U+FFFE as "undefined mapping"
in any mapping, not only in an unicode string.
13 years ago
Serhiy Storchaka
9599745e2c
Issue #14850 : Now a chamap decoder treates U+FFFE as "undefined mapping"
in any mapping, not only in an unicode string.
13 years ago
Benjamin Peterson
0c270a8bb7
correct static string clearing loop ( closes #16906 )
13 years ago
Serhiy Storchaka
48e188e573
Issue #11461 : Fix the incremental UTF-16 decoder. Original patch by
Amaury Forgeot d'Arc. Added tests for partial decoding of non-BMP
characters.
13 years ago
Serhiy Storchaka
c4b82c037e
Issue #11461 : Fix the incremental UTF-16 decoder. Original patch by
Amaury Forgeot d'Arc. Added tests for partial decoding of non-BMP
characters.
13 years ago
Serhiy Storchaka
dec798eb46
Fix out of bound read in UTF-32 decoder on "narrow Unicode" builds.
13 years ago
Serhiy Storchaka
c9631a14d7
Fix out of bound read in UTF-32 decoder on "narrow Unicode" builds.
13 years ago
Serhiy Storchaka
6c83e739d7
Issue #16856 : Fix a segmentation fault from calling repr() on a dict with
a key whose repr raise an exception.
13 years ago
Victor Stinner
20b654acb5
Issue #16455 : On FreeBSD and Solaris, if the locale is C, the
ASCII/surrogateescape codec is now used, instead of the locale encoding, to
decode the command line arguments. This change fixes inconsistencies with
os.fsencode() and os.fsdecode() because these operating systems announces an
ASCII locale encoding, whereas the ISO-8859-1 encoding is used in practice.
13 years ago
Gregory P. Smith
27cbcd6241
Fix the internals of our hash functions to used unsigned values during hash
computation as the overflow behavior of signed integers is undefined.
In practice we require compiling everything with -fwrapv which forces overflow
to be defined as twos compliment but this keeps the code cleaner for checkers
or in the case where someone has compiled it without -fwrapv or their
compiler's equivalent.
Found by Clang trunk's Undefined Behavior Sanitizer (UBSan).
Cleanup only - no functionality or hash values change.
13 years ago
Victor Stinner
27b1ca29cc
Issue #16416 : On Mac OS X, operating system data are now always
encoded/decoded to/from UTF-8/surrogateescape, instead of the locale encoding
(which may be ASCII if no locale environment variable is set), to avoid
inconsistencies with os.fsencode() and os.fsdecode() functions which are
already using UTF-8/surrogateescape.
13 years ago
Antoine Pitrou
6d5ad227a5
Issue #16215 : Fix potential double memory free in str.replace().
Patch by Serhiy Storchaka.
14 years ago
Antoine Pitrou
e3ae321222
Issue #15379 : Fix passing of non-BMP characters as integers for the charmap decoder (already working as unicode strings).
Patch by Serhiy Storchaka.
14 years ago
Ezio Melotti
f7ed5d111b
#8271 : the utf-8 decoder now outputs the correct number of U+FFFD characters when used with the "replace" error handler on invalid utf-8 sequences. Patch by Serhiy Storchaka, tests by Ezio Melotti.
14 years ago
Benjamin Peterson
c43112823b
initialize more global type objects ( closes #16369 )
14 years ago
Benjamin Peterson
6da3ed63d8
initialize more global type objects ( closes #16369 )
14 years ago