Module: kamailio
Branch: master
Commit: 15f57ceae26b967ad92dd3a97ebcd869d1197244
URL:
https://github.com/kamailio/kamailio/commit/15f57ceae26b967ad92dd3a97ebcd86…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com>
Committer: Daniel-Constantin Mierla <miconda(a)gmail.com>
Date: 2021-04-15T10:28:24+02:00
core: main - set ending 0 in allocated cfg file path
---
Modified: src/main.c
---
Diff:
https://github.com/kamailio/kamailio/commit/15f57ceae26b967ad92dd3a97ebcd86…
Patch:
https://github.com/kamailio/kamailio/commit/15f57ceae26b967ad92dd3a97ebcd86…
---
diff --git a/src/main.c b/src/main.c
index 405b442158..71a024d5bb 100644
--- a/src/main.c
+++ b/src/main.c
@@ -1288,7 +1288,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;
}