Module: kamailio
Branch: 5.5
Commit: 23470fccf6e54d7f853e6df4ab519feb30272721
URL:
https://github.com/kamailio/kamailio/commit/23470fccf6e54d7f853e6df4ab519fe…
Author: Victor Seva <vseva(a)sipwise.com>
Committer: Daniel-Constantin Mierla <miconda(a)gmail.com>
Date: 2023-07-17T11:16:35+02:00
app_lua: fix crash on exausted memory scenario
(cherry picked from commit ef94da7bac8e2aaf5a452d7b7dc3e2b544153ff6)
(cherry picked from commit b524321a4871c349e6ebb464ea018e138bc6d5ed)
---
Modified: src/modules/app_lua/app_lua_api.c
---
Diff:
https://github.com/kamailio/kamailio/commit/23470fccf6e54d7f853e6df4ab519fe…
Patch:
https://github.com/kamailio/kamailio/commit/23470fccf6e54d7f853e6df4ab519fe…
---
diff --git a/src/modules/app_lua/app_lua_api.c b/src/modules/app_lua/app_lua_api.c
index f736bea98b9..c3d16c98129 100644
--- a/src/modules/app_lua/app_lua_api.c
+++ b/src/modules/app_lua/app_lua_api.c
@@ -852,6 +852,10 @@ void sr_kemi_lua_push_dict(lua_State *L, sr_kemi_dict_item_t *item)
{
void
sr_kemi_lua_push_dict_item(lua_State *L, sr_kemi_dict_item_t *item)
{
+ if(!item) {
+ LM_CRIT("BUG: dict field empty\n");
+ return;
+ }
switch(item->vtype) {
case SR_KEMIP_NONE:
LM_CRIT("BUG: vtype is NONE\n");
@@ -891,6 +895,10 @@ sr_kemi_lua_push_dict_item(lua_State *L, sr_kemi_dict_item_t *item)
*/
int sr_kemi_lua_return_xval(lua_State* L, sr_kemi_t *ket, sr_kemi_xval_t *rx)
{
+ if(!rx) {
+ LM_CRIT("BUG: xval field empty\n");
+ return 0;
+ }
switch(rx->vtype) {
case SR_KEMIP_NONE:
return 0;