Module: kamailio Branch: master Commit: 35e1e9cb27129f410352590b01d2a101b6ea98c4 URL: https://github.com/kamailio/kamailio/commit/35e1e9cb27129f410352590b01d2a101b6ea98c4
Author: Victor Seva <[email protected]> Committer: Victor Seva <[email protected]> Date: 2025-09-23T18:08:34+02:00 dlg_var: use memcpy for coping data --- Modified: src/modules/dialog/dlg_var.c --- Diff: https://github.com/kamailio/kamailio/commit/35e1e9cb27129f410352590b01d2a101b6ea98c4.diff Patch: https://github.com/kamailio/kamailio/commit/35e1e9cb27129f410352590b01d2a101b6ea98c4.patch --- diff --git a/src/modules/dialog/dlg_var.c b/src/modules/dialog/dlg_var.c index 3368728297c..f1ee3e1dbdd 100644 --- a/src/modules/dialog/dlg_var.c +++ b/src/modules/dialog/dlg_var.c @@ -670,7 +670,7 @@ int pv_set_dlg_ctx( if(val->rs.len < DLG_TOROUTE_SIZE && val->rs.s[val->rs.len] == '\0') { _dlg_ctx.to_route = route_lookup(&main_rt, val->rs.s); - strcpy(_dlg_ctx.to_route_name, val->rs.s); + memcpy(_dlg_ctx.to_route_name, val->rs.s, val->rs.len); } else { _dlg_ctx.to_route = 0; } @@ -679,7 +679,7 @@ int pv_set_dlg_ctx( rtp = int2str(n, &rlen); if(rlen < DLG_TOROUTE_SIZE) { _dlg_ctx.to_route = route_lookup(&main_rt, rtp); - strcpy(_dlg_ctx.to_route_name, rtp); + memcpy(_dlg_ctx.to_route_name, rtp, rlen); } else { _dlg_ctx.to_route = 0; } _______________________________________________ Kamailio - Development Mailing List -- [email protected] To unsubscribe send an email to [email protected] Important: keep the mailing list in the recipients, do not reply only to the sender!
