summaryrefslogtreecommitdiffstats
path: root/Python/traceback.c
diff options
context:
space:
mode:
authorChristian Heimes <christian@cheimes.de>2008-01-18 08:47:59 (GMT)
committerChristian Heimes <christian@cheimes.de>2008-01-18 08:47:59 (GMT)
commit3e8c897d80db38613f26b2f4c120f9e15a8ae9d2 (patch)
tree9eca678ef69659ca6428bbec3e6d0596af6de102 /Python/traceback.c
parent87dcf3d260e183ed2988fe35b0ac3b93df37763b (diff)
downloadcpython-3e8c897d80db38613f26b2f4c120f9e15a8ae9d2.zip
cpython-3e8c897d80db38613f26b2f4c120f9e15a8ae9d2.tar.gz
cpython-3e8c897d80db38613f26b2f4c120f9e15a8ae9d2.tar.bz2
Coverity issue CID #169
local_ptr_assign_local: Assigning address of stack variable "namebuf" to pointer "filename" out_of_scope: Variable "namebuf" goes out of scope use_invalid: Used "filename" pointing to out-of-scope variable "namebuf"
Diffstat (limited to 'Python/traceback.c')
-rw-r--r--Python/traceback.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/Python/traceback.c b/Python/traceback.c
index d6f68ab..877ca5a 100644
--- a/Python/traceback.c
+++ b/Python/traceback.c
@@ -129,6 +129,8 @@ tb_displayline(PyObject *f, char *filename, int lineno, char *name)
FILE *xfp;
char linebuf[2000];
int i;
+ char namebuf[MAXPATHLEN+1];
+
if (filename == NULL || name == NULL)
return -1;
/* This is needed by Emacs' compile command */
@@ -147,7 +149,6 @@ tb_displayline(PyObject *f, char *filename, int lineno, char *name)
Py_ssize_t _npath = PyList_Size(path);
int npath = Py_SAFE_DOWNCAST(_npath, Py_ssize_t, int);
size_t taillen = strlen(tail);
- char namebuf[MAXPATHLEN+1];
for (i = 0; i < npath; i++) {
PyObject *v = PyList_GetItem(path, i);
if (v == NULL) {