Skip to content

Commit

Permalink
Update parson and fix json_object_set_value (#983)
Browse files Browse the repository at this point in the history
* Remove parson folder

* add submodule parson

* FIX amxx_json_object_set_value generate a crash if invalid value is passed

* restore parson folder status
  • Loading branch information
francoromaniello authored and Arkshine committed Sep 17, 2021
1 parent f5fea6a commit bb4b818
Show file tree
Hide file tree
Showing 3 changed files with 808 additions and 354 deletions.
6 changes: 6 additions & 0 deletions modules/json/JsonNatives.cpp
Expand Up @@ -697,6 +697,12 @@ static cell AMX_NATIVE_CALL amxx_json_object_set_value(AMX *amx, cell *params)
return 0;
}

if (!JsonMngr->IsValidHandle(params[3], Handle_Object))
{
MF_LogError(amx, AMX_ERR_NATIVE, "Invalid JSON value! %d", params[3]);
return 0;
}

int len;
auto name = MF_GetAmxString(amx, params[2], 0, &len);

Expand Down

0 comments on commit bb4b818

Please sign in to comment.