Module: kamailio
Branch: master
Commit: e1a3e0d6f21507bc6f6ccb2e50a03c19872ff04b
URL:
https://github.com/kamailio/kamailio/commit/e1a3e0d6f21507bc6f6ccb2e50a03c1…
Author: Victor Seva <linuxmaniac(a)torreviejawireless.org>
Committer: Victor Seva <linuxmaniac(a)torreviejawireless.org>
Date: 2019-12-09T09:19:17+01:00
cfgt: use snprintf instead of sprintf
---
Modified: src/modules/cfgt/cfgt_int.c
---
Diff:
https://github.com/kamailio/kamailio/commit/e1a3e0d6f21507bc6f6ccb2e50a03c1…
Patch:
https://github.com/kamailio/kamailio/commit/e1a3e0d6f21507bc6f6ccb2e50a03c1…
---
diff --git a/src/modules/cfgt/cfgt_int.c b/src/modules/cfgt/cfgt_int.c
index 7582bec61f..5f73a05bc8 100644
--- a/src/modules/cfgt/cfgt_int.c
+++ b/src/modules/cfgt/cfgt_int.c
@@ -112,7 +112,8 @@ void _cfgt_remove_report(const str *scen)
continue;
}
}
- sprintf(filepath.s, "%s/%s", dest.s, next_file->d_name);
+ snprintf(filepath.s, dest.len + 1, "%s/%s", dest.s,
+ next_file->d_name);
if(remove(filepath.s) < 0) {
LM_ERR("failed removing file: %s\n", strerror(errno));
} else {