Module: kamailio
Branch: master
Commit: c2ff02b6d07c0f84dcbe5d0d47de3f12ed791e3a
URL: 
https://github.com/kamailio/kamailio/commit/c2ff02b6d07c0f84dcbe5d0d47de3f12ed791e3a

Author: Daniel-Constantin Mierla <mico...@gmail.com>
Committer: Daniel-Constantin Mierla <mico...@gmail.com>
Date: 2024-11-28T10:35:19+01:00

core: modparam - use memcpy for data cloning

---

Modified: src/core/modparam.c

---

Diff:  
https://github.com/kamailio/kamailio/commit/c2ff02b6d07c0f84dcbe5d0d47de3f12ed791e3a.diff
Patch: 
https://github.com/kamailio/kamailio/commit/c2ff02b6d07c0f84dcbe5d0d47de3f12ed791e3a.patch

---

diff --git a/src/core/modparam.c b/src/core/modparam.c
index b48d9e82442..a166cc50706 100644
--- a/src/core/modparam.c
+++ b/src/core/modparam.c
@@ -151,7 +151,7 @@ int set_mod_param_regex(char *regex, char *name, modparam_t 
type, void *val)
                                                                pkg_free(reg);
                                                                return -1;
                                                        }
-                                                       strncpy(*((char 
**)ptr), (char *)val2, len_param);
+                                                       memcpy(*((char **)ptr), 
(char *)val2, len_param);
                                                        (*((char 
**)ptr))[len_param] = '\0';
                                                        break;
 

_______________________________________________
Kamailio - Development Mailing List -- sr-dev@lists.kamailio.org
To unsubscribe send an email to sr-dev-le...@lists.kamailio.org
Important: keep the mailing list in the recipients, do not reply only to the 
sender!

Reply via email to