From fbf9a5b27c5e6e5492651458bbeabca7853047cc Mon Sep 17 00:00:00 2001 From: Riccardo Magliocchetti Date: Mon, 23 Dec 2013 16:53:41 +0100 Subject: [PATCH] uwsgi_app.chdir is an array So check if it's first member is not 0 instead. Fix Coverity CID #971000, #970998. --- core/master_utils.c | 2 +- plugins/python/uwsgi_pymodule.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/core/master_utils.c b/core/master_utils.c index cf6954a8..d9b4e4b8 100644 --- a/core/master_utils.c +++ b/core/master_utils.c @@ -1097,7 +1097,7 @@ struct uwsgi_stats *uwsgi_master_generate_stats() { if (uwsgi_stats_keylong_comma(us, "exceptions", ua->exceptions)) goto end; - if (ua->chdir) { + if (*ua->chdir) { if (uwsgi_stats_keyval(us, "chdir", ua->chdir)) goto end; } diff --git a/plugins/python/uwsgi_pymodule.c b/plugins/python/uwsgi_pymodule.c index 7f577260..0ab77662 100644 --- a/plugins/python/uwsgi_pymodule.c +++ b/plugins/python/uwsgi_pymodule.c @@ -2165,7 +2165,7 @@ PyObject *py_uwsgi_workers(PyObject * self, PyObject * args) { PyDict_SetItemString(apps_dict, "exceptions", zero); Py_DECREF(zero); - if (ua->chdir) { + if (*ua->chdir) { zero = PyString_FromString(ua->chdir); } else {