mirror of
https://github.com/python/cpython.git
synced 2025-08-02 16:13:13 +00:00
Fix problems found by Coverity.
longobject.c: also fix an ssize_t problem <a> could have been NULL, so hoist the size calc to not use <a>. _ssl.c: under fail: self is DECREF'd, but it would have been NULL. _elementtree.c: delete self if there was an error. _csv.c: I'm not sure if lineterminator could have been anything other than a string. However, other string method calls are checked, so check this one too.
This commit is contained in:
parent
ad2ef33245
commit
c6a989ac3a
4 changed files with 12 additions and 8 deletions
|
@ -1104,6 +1104,8 @@ join_append_lineterminator(WriterObj *self)
|
|||
char *terminator;
|
||||
|
||||
terminator_len = PyString_Size(self->dialect->lineterminator);
|
||||
if (terminator_len == -1)
|
||||
return 0;
|
||||
|
||||
/* grow record buffer if necessary */
|
||||
if (!join_check_rec_size(self, self->rec_len + terminator_len))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue