mirror of
https://github.com/python/cpython.git
synced 2025-11-01 02:38:53 +00:00
SF #1444030: Fix several potential defects found by Coverity.
(reviewed by Neal Norwitz)
This commit is contained in:
parent
ef1701f7d3
commit
4af5c8cee4
11 changed files with 53 additions and 17 deletions
|
|
@ -185,8 +185,12 @@ tb_displayline(PyObject *f, char *filename, int lineno, char *name)
|
|||
}
|
||||
PyOS_snprintf(linebuf, sizeof(linebuf), FMT, filename, lineno, name);
|
||||
err = PyFile_WriteString(linebuf, f);
|
||||
if (xfp == NULL || err != 0)
|
||||
if (xfp == NULL)
|
||||
return err;
|
||||
else if (err != 0) {
|
||||
fclose(xfp);
|
||||
return err;
|
||||
}
|
||||
for (i = 0; i < lineno; i++) {
|
||||
char* pLastChar = &linebuf[sizeof(linebuf)-2];
|
||||
do {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue