Module: kamailio Branch: 5.4 Commit: 38d72250f4c9c77bee71262b6c340503cc9a92a2 URL: https://github.com/kamailio/kamailio/commit/38d72250f4c9c77bee71262b6c340503...
Author: Daniel-Constantin Mierla miconda@gmail.com Committer: Daniel-Constantin Mierla miconda@gmail.com Date: 2021-04-15T10:29:43+02:00
core: main - set ending 0 in allocated cfg file path
(cherry picked from commit 15f57ceae26b967ad92dd3a97ebcd869d1197244)
---
Modified: src/main.c
---
Diff: https://github.com/kamailio/kamailio/commit/38d72250f4c9c77bee71262b6c340503... Patch: https://github.com/kamailio/kamailio/commit/38d72250f4c9c77bee71262b6c340503...
---
diff --git a/src/main.c b/src/main.c index ad83cff3a8..3a67f841e6 100644 --- a/src/main.c +++ b/src/main.c @@ -1281,7 +1281,7 @@ int fix_cfg_file(void) } if ((res = malloc(cfg_len + 1)) == NULL) goto error; memcpy(res, cfg_file, cfg_len); - cfg_file[cfg_len] = 0; + res[cfg_len] = 0; cfg_file = res; return 0; }