mirror of
https://github.com/clearlinux/uwsgi.git
synced 2026-10-03 23:48:22 +00:00
core/exception: avoid null pointer dereference in uwsgi_exception_run_handlers
If wsgi_req is NULL and uwsgi.reload_on_exception is True Reported by Coverity as CID #989244.
This commit is contained in:
+4
-7
@@ -316,12 +316,11 @@ static void uwsgi_exception_run_handlers(struct uwsgi_buffer *ub) {
|
||||
|
||||
void uwsgi_manage_exception(struct wsgi_request *wsgi_req,int catch) {
|
||||
|
||||
int do_exit = 0;
|
||||
int do_exit = uwsgi.reload_on_exception;
|
||||
|
||||
if (uwsgi.reload_on_exception) {
|
||||
do_exit = 1;
|
||||
goto check_catch;
|
||||
}
|
||||
if (!wsgi_req) goto log2;
|
||||
|
||||
if (do_exit) goto check_catch;
|
||||
|
||||
if (wsgi_req && uwsgi.exception_handlers_instance) {
|
||||
struct uwsgi_buffer *ehi = uwsgi_exception_handler_object(wsgi_req);
|
||||
@@ -331,8 +330,6 @@ void uwsgi_manage_exception(struct wsgi_request *wsgi_req,int catch) {
|
||||
}
|
||||
}
|
||||
|
||||
if (!wsgi_req) goto log2;
|
||||
|
||||
uwsgi.workers[uwsgi.mywid].cores[wsgi_req->async_id].exceptions++;
|
||||
uwsgi_apps[wsgi_req->app_id].exceptions++;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user