FS-10300: [mod_verto] fix crash in verto.answer processing when missing params in message

This commit is contained in:
Mike Jerris 2017-05-09 10:47:00 -05:00
parent faf87febdb
commit 5d8fad1ee1
1 changed files with 5 additions and 0 deletions

View File

@ -2675,6 +2675,11 @@ static switch_bool_t verto__answer_func(const char *method, cJSON *params, jsock
*response = obj;
if (!params) {
cJSON_AddItemToObject(obj, "message", cJSON_CreateString("Params data missing"));
err = 1; goto cleanup;
}
if (!(dialog = cJSON_GetObjectItem(params, "dialogParams"))) {
cJSON_AddItemToObject(obj, "message", cJSON_CreateString("Dialog data missing"));
err = 1; goto cleanup;