Module: kamailio
Branch: master
Commit: eab6682e4d8bebaf97f85c55b0863ad435e1d133
URL:
https://github.com/kamailio/kamailio/commit/eab6682e4d8bebaf97f85c55b0863ad…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com>
Committer: Daniel-Constantin Mierla <miconda(a)gmail.com>
Date: 2024-11-28T10:39:44+01:00
keepalive: use memcpy for coping data
---
Modified: src/modules/keepalive/keepalive_core.c
---
Diff:
https://github.com/kamailio/kamailio/commit/eab6682e4d8bebaf97f85c55b0863ad…
Patch:
https://github.com/kamailio/kamailio/commit/eab6682e4d8bebaf97f85c55b0863ad…
---
diff --git a/src/modules/keepalive/keepalive_core.c
b/src/modules/keepalive/keepalive_core.c
index b1b3581cb34..4c8a186b660 100644
--- a/src/modules/keepalive/keepalive_core.c
+++ b/src/modules/keepalive/keepalive_core.c
@@ -210,9 +210,10 @@ int ka_str_copy(str *src, str *dest, char *prefix)
return -1;
}
- if(prefix)
- strncpy(dest->s, prefix, lp);
- strncpy(dest->s + lp, src->s, src->len);
+ if(prefix) {
+ memcpy(dest->s, prefix, lp);
+ }
+ memcpy(dest->s + lp, src->s, src->len);
dest->s[src->len + lp] = '\0';
dest->len = src->len + lp;