This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author vstinner
Recipients methane, vstinner
Date 2017-12-21.20:50:02
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1513889402.22.0.213398074469.issue32402@psf.upfronthosting.co.za>
In-reply-to
Content
The following warning may have been introduced by the commit 507434fd504f3ebc1da72aa77544edc0d73f136e from bpo-15216.

New defect(s) Reported-by: Coverity Scan
Showing 2 of 2 defect(s)


** CID 1426868:  Null pointer dereferences  (NULL_RETURNS)
/Modules/_io/textio.c: 1251 in textiowrapper_change_encoding()

________________________________________________________________________________________________________
*** CID 1426868:  Null pointer dereferences  (NULL_RETURNS)
/Modules/_io/textio.c: 1251 in textiowrapper_change_encoding()
1245             encoding = self->encoding;
1246             if (errors == Py_None) {
1247                 errors = self->errors;
1248             }
1249         }
1250         else if (errors == Py_None) {
>>>     CID 1426868:  Null pointer dereferences  (NULL_RETURNS)
>>>     Assigning: "errors" = null return value from "_PyUnicode_FromId".
1251             errors = _PyUnicode_FromId(&PyId_strict);
1252         }
1253
1254         const char *c_errors = PyUnicode_AsUTF8(errors);
1255         if (c_errors == NULL) {
1256             return -1;

** CID 1426867:  Null pointer dereferences  (NULL_RETURNS)
/Modules/_io/textio.c: 1153 in _io_TextIOWrapper___init___impl()


________________________________________________________________________________________________________
*** CID 1426867:  Null pointer dereferences  (NULL_RETURNS)
/Modules/_io/textio.c: 1153 in _io_TextIOWrapper___init___impl()
1147         }
1148
1149         /* XXX: Failures beyond this point have the potential to leak elements
1150          * of the partially constructed object (like self->encoding)
1151          */
1152
>>>     CID 1426867:  Null pointer dereferences  (NULL_RETURNS)
>>>     Dereferencing a null pointer "errors".
1153         Py_INCREF(errors);
1154         self->errors = errors;
1155         self->chunk_size = 8192;
1156         self->line_buffering = line_buffering;
1157         self->write_through = write_through;
1158         if (set_newline(self, newline) < 0) {
History
Date User Action Args
2017-12-21 20:50:02vstinnersetrecipients: + vstinner, methane
2017-12-21 20:50:02vstinnersetmessageid: <1513889402.22.0.213398074469.issue32402@psf.upfronthosting.co.za>
2017-12-21 20:50:02vstinnerlinkissue32402 messages
2017-12-21 20:50:02vstinnercreate