Module: kamailio
Branch: master
Commit: 10aa4442ac68024e062f7776000cfc0b93129c5a
URL:
https://github.com/kamailio/kamailio/commit/10aa4442ac68024e062f7776000cfc0…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com>
Committer: Daniel-Constantin Mierla <miconda(a)gmail.com>
Date: 2023-11-20T13:52:03+01:00
core: cfg.y - copy number string value with memcpy()
---
Modified: src/core/cfg.y
---
Diff:
https://github.com/kamailio/kamailio/commit/10aa4442ac68024e062f7776000cfc0…
Patch:
https://github.com/kamailio/kamailio/commit/10aa4442ac68024e062f7776000cfc0…
---
diff --git a/src/core/cfg.y b/src/core/cfg.y
index 9cfce12ce94..b9e293aa923 100644
--- a/src/core/cfg.y
+++ b/src/core/cfg.y
@@ -2761,11 +2761,13 @@ host_if_id: ID
| NUM_ID
| NUMBER {
/* get string version */
- $$=pkg_malloc(strlen(yy_number_str)+1);
+ i_tmp = strlen(yy_number_str);
+ $$=pkg_malloc(i_tmp + 1);
if ($$==0) {
PKG_MEM_ERROR;
} else {
- strcpy($$, yy_number_str);
+ memcpy($$, yy_number_str, i_tmp);
+ $$[i_tmp] = '\0';
}
}
;