diff options
author | Jelmer Vernooij <jelmer@samba.org> | 2012-11-22 00:46:55 +0000 |
---|---|---|
committer | Matthieu Patou <mat@matws.net> | 2012-11-22 14:56:59 -0800 |
commit | 31f0e24fbe5f3da7e1a3e4b0ae234c0803123501 (patch) | |
tree | b4076152eccfe743a7dc6807d108cccc7b9d3a25 | |
parent | f22e15d9d5a3d4744982265363c357ef277ba31e (diff) | |
download | samba-31f0e24fbe5f3da7e1a3e4b0ae234c0803123501.tar.gz samba-31f0e24fbe5f3da7e1a3e4b0ae234c0803123501.tar.bz2 samba-31f0e24fbe5f3da7e1a3e4b0ae234c0803123501.zip |
web_server/wsgi: Don't segfault when wsgi app doesn't return iterable.
There is a bug in the application if this happens, but invalid Python
code shouldn't cause segfaults.
Reviewed-by: Matthieu Patou <mat@matws.net>
-rw-r--r-- | source4/web_server/wsgi.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/source4/web_server/wsgi.c b/source4/web_server/wsgi.c index 37ded29480..3f8141c5e2 100644 --- a/source4/web_server/wsgi.c +++ b/source4/web_server/wsgi.c @@ -369,6 +369,11 @@ static void wsgi_process_http_input(struct web_server_data *wdata, iter = PyObject_GetIter(result); Py_DECREF(result); + if (iter == NULL) { + DEBUG(0, ("wsgi application did not return iterable\n")); + return; + } + /* Now, iter over all the data returned */ while ((item = PyIter_Next(iter))) { |