Module: kamailio
Branch: master
Commit: c8de7e9bbb515449761b02b897ccaa10a250e25b
URL:
https://github.com/kamailio/kamailio/commit/c8de7e9bbb515449761b02b897ccaa1…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com>
Committer: Daniel-Constantin Mierla <miconda(a)gmail.com>
Date: 2019-11-18T18:33:22+01:00
utils/kamunix: use snprintf() instead of sprintf()
---
Modified: utils/kamunix/kamunix.c
---
Diff:
https://github.com/kamailio/kamailio/commit/c8de7e9bbb515449761b02b897ccaa1…
Patch:
https://github.com/kamailio/kamailio/commit/c8de7e9bbb515449761b02b897ccaa1…
---
diff --git a/utils/kamunix/kamunix.c b/utils/kamunix/kamunix.c
index 7612a9e32d..6b06e29a2e 100644
--- a/utils/kamunix/kamunix.c
+++ b/utils/kamunix/kamunix.c
@@ -75,7 +75,7 @@ int main(int argc, char** argv)
chroot_dir = getenv("CHROOT_DIR");
if (chroot_dir == NULL)
chroot_dir = "";
- sprintf(name, "%s/tmp/Kamailio.%d.XXXXXX", chroot_dir, getpid());
+ snprintf(name, 256, "%s/tmp/Kamailio.%d.XXXXXX", chroot_dir, getpid());
umask(0);
/* set mode to 0666 for when Kamailio is running as non-root user
* and kamctl is running as root */