Module: kamailio
Branch: master
Commit: 7bdd7fb4aa666b5f56ae3e554770126ad5b68c2e
URL:
https://github.com/kamailio/kamailio/commit/7bdd7fb4aa666b5f56ae3e554770126…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com>
Committer: Daniel-Constantin Mierla <miconda(a)gmail.com>
Date: 2023-11-09T15:32:39+01:00
dialog: use memcpy to fill profile uid
---
Modified: src/modules/dialog/dlg_profile.c
---
Diff:
https://github.com/kamailio/kamailio/commit/7bdd7fb4aa666b5f56ae3e554770126…
Patch:
https://github.com/kamailio/kamailio/commit/7bdd7fb4aa666b5f56ae3e554770126…
---
diff --git a/src/modules/dialog/dlg_profile.c b/src/modules/dialog/dlg_profile.c
index fd605d000c9..5dd3b372d49 100644
--- a/src/modules/dialog/dlg_profile.c
+++ b/src/modules/dialog/dlg_profile.c
@@ -603,7 +603,9 @@ int set_dlg_profile(
}
sruid_next_safe(&_dlg_profile_sruid);
if(_dlg_profile_sruid.uid.len < SRUID_SIZE) {
- strcpy(linker->hash_linker.puid, _dlg_profile_sruid.uid.s);
+ memcpy(linker->hash_linker.puid, _dlg_profile_sruid.uid.s,
+ _dlg_profile_sruid.uid.len);
+ linker->hash_linker.puid[_dlg_profile_sruid.uid.len] = '\0';
linker->hash_linker.puid_len = _dlg_profile_sruid.uid.len;
} else {
LM_ERR("sruid size is too large\n");
@@ -951,7 +953,7 @@ int dlg_set_timeout_by_profile(
unsigned int h_id;
unsigned int h_entry;
struct dlg_map_list *next;
- } * map_head, *map_scan, *map_scan_next;
+ } *map_head, *map_scan, *map_scan_next;
map_head = NULL;