[sr-dev] git:master:e1a3e0d6: cfgt: use snprintf instead of sprintf
Victor Seva
linuxmaniac at torreviejawireless.org
Mon Dec 9 09:20:03 CET 2019
Module: kamailio
Branch: master
Commit: e1a3e0d6f21507bc6f6ccb2e50a03c19872ff04b
URL: https://github.com/kamailio/kamailio/commit/e1a3e0d6f21507bc6f6ccb2e50a03c19872ff04b
Author: Victor Seva <linuxmaniac at torreviejawireless.org>
Committer: Victor Seva <linuxmaniac at 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/e1a3e0d6f21507bc6f6ccb2e50a03c19872ff04b.diff
Patch: https://github.com/kamailio/kamailio/commit/e1a3e0d6f21507bc6f6ccb2e50a03c19872ff04b.patch
---
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 {
More information about the sr-dev
mailing list