diff --git a/debian/patches/series b/debian/patches/series index adf5472ba..3748d9690 100644 --- a/debian/patches/series +++ b/debian/patches/series @@ -65,6 +65,7 @@ upstream/cfgt-add-docs-for-missing-RPC-commands.patch upstream/cfgt-doc-add-missing-section.patch upstream/cfgt-remove-dbg-from-RPC-commands.patch upstream/cfgt-add-RPC-commands-cfgt.list-and-cfgt.clean.patch +upstream/cfgt-use-snprintf-instead-of-sprintf.patch ### relevant for upstream sipwise/fix_error_in_cfgt_module.patch # diff --git a/debian/patches/upstream/cfgt-use-snprintf-instead-of-sprintf.patch b/debian/patches/upstream/cfgt-use-snprintf-instead-of-sprintf.patch new file mode 100644 index 000000000..e41f7f9d5 --- /dev/null +++ b/debian/patches/upstream/cfgt-use-snprintf-instead-of-sprintf.patch @@ -0,0 +1,26 @@ +From e1a3e0d6f21507bc6f6ccb2e50a03c19872ff04b Mon Sep 17 00:00:00 2001 +From: Victor Seva +Date: Mon, 9 Dec 2019 09:19:17 +0100 +Subject: [PATCH] cfgt: use snprintf instead of sprintf + +--- + src/modules/cfgt/cfgt_int.c | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +diff --git a/src/modules/cfgt/cfgt_int.c b/src/modules/cfgt/cfgt_int.c +index 7582bec61..5f73a05bc 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 { +-- +2.20.1 +