Module: kamailio
Branch: master
Commit: d48ae7995374ee4be01cdd28b4f65706a04b620c
URL:
https://github.com/kamailio/kamailio/commit/d48ae7995374ee4be01cdd28b4f6570…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com>
Committer: Daniel-Constantin Mierla <miconda(a)gmail.com>
Date: 2019-11-25T12:02:01+01:00
app_lua_sr: use snprintf() instead of sprintf()
---
Modified: src/modules/app_lua_sr/app_lua_sr_exp.c
---
Diff:
https://github.com/kamailio/kamailio/commit/d48ae7995374ee4be01cdd28b4f6570…
Patch:
https://github.com/kamailio/kamailio/commit/d48ae7995374ee4be01cdd28b4f6570…
---
diff --git a/src/modules/app_lua_sr/app_lua_sr_exp.c
b/src/modules/app_lua_sr/app_lua_sr_exp.c
index 7218b206f2..3dab788436 100644
--- a/src/modules/app_lua_sr/app_lua_sr_exp.c
+++ b/src/modules/app_lua_sr/app_lua_sr_exp.c
@@ -655,7 +655,7 @@ static int lua_sr_tm_t_on_branch_failure(lua_State *L)
}
rt_name.len = rt_name_len;
}
- sprintf(rt_name.s, "%s:%s", BRANCH_FAILURE_ROUTE_PREFIX, name);
+ snprintf(rt_name.s, rt_name_len+1, "%s:%s", BRANCH_FAILURE_ROUTE_PREFIX,
name);
i = route_get(&event_rt, rt_name.s);
if(i < 0 || event_rt.rlist[i]==0)