diff options
author | 2018-10-31 05:36:20 -0700 | |
---|---|---|
committer | 2018-10-31 05:36:20 -0700 | |
commit | 71b6c1af727fbe13525fb734568057d78cea33f3 (patch) | |
tree | 5c21fd44694813a375597f3aa5e49f43e965f2fd /Modules/_io | |
parent | Fix a possible crash in range.__reversed__(). (GH-10252) (diff) | |
download | cpython-71b6c1af727fbe13525fb734568057d78cea33f3.tar.gz cpython-71b6c1af727fbe13525fb734568057d78cea33f3.tar.bz2 cpython-71b6c1af727fbe13525fb734568057d78cea33f3.zip |
bpo-35062: Fix parsing _io.IncrementalNewlineDecoder's *translate* argument. (GH-10217)
_io.IncrementalNewlineDecoder's initializer possibly assigns out-of-range
value to the bitwise struct field.
(cherry picked from commit b08746bfdf64e55ce33516f2065fa2aa4f51be95)
Co-authored-by: Xiang Zhang <angwerzx@126.com>
Diffstat (limited to 'Modules/_io')
-rw-r--r-- | Modules/_io/textio.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/Modules/_io/textio.c b/Modules/_io/textio.c index d6b1e943788..73d1b2e8a23 100644 --- a/Modules/_io/textio.c +++ b/Modules/_io/textio.c @@ -261,7 +261,7 @@ _io_IncrementalNewlineDecoder___init___impl(nldecoder_object *self, } Py_INCREF(self->errors); - self->translate = translate; + self->translate = translate ? 1 : 0; self->seennl = 0; self->pendingcr = 0; |