Module: kamailio
Branch: 5.4
Commit: 38d72250f4c9c77bee71262b6c340503cc9a92a2
URL: 
https://github.com/kamailio/kamailio/commit/38d72250f4c9c77bee71262b6c340503cc9a92a2

Author: Daniel-Constantin Mierla <[email protected]>
Committer: Daniel-Constantin Mierla <[email protected]>
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/38d72250f4c9c77bee71262b6c340503cc9a92a2.diff
Patch: 
https://github.com/kamailio/kamailio/commit/38d72250f4c9c77bee71262b6c340503cc9a92a2.patch

---

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;
        }


_______________________________________________
Kamailio (SER) - Development Mailing List
[email protected]
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-dev

Reply via email to