From a5bc23aa71e4d519cf4ee901ef83c500c65601bb Mon Sep 17 00:00:00 2001 From: "Evgeny Grin (Karlson2k)" Date: Sun, 1 Sep 2024 10:55:06 +0200 Subject: [PATCH] MHD_upload_action_from_response(): fixed NULL response processing --- src/mhd2/action.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/mhd2/action.c b/src/mhd2/action.c index db46c627..c104ab88 100644 --- a/src/mhd2/action.c +++ b/src/mhd2/action.c @@ -144,7 +144,7 @@ MHD_action_parse_post (struct MHD_Request *request, } -MHD_EXTERN_ MHD_FN_RETURNS_NONNULL_ MHD_FN_PAR_NONNULL_ALL_ +MHD_EXTERN_ MHD_FN_PAR_NONNULL_ALL_ const struct MHD_UploadAction * MHD_upload_action_suspend (struct MHD_Request *request) { @@ -166,6 +166,8 @@ MHD_upload_action_from_response (struct MHD_Request *request, { struct MHD_UploadAction *const restrict upl_act = &(request->app_act.upl_act); + if (NULL == response) + return (const struct MHD_Action *) NULL; if (mhd_UPLOAD_ACTION_NO_ACTION != upl_act->act) return (const struct MHD_UploadAction *) NULL;