TT#72700 cfgt: add upstream fix for printf

Change-Id: Icf6177853298f4b7d746e928aedb0c55227a3615
changes/41/36141/2
Victor Seva 7 years ago
parent b3872eb0c5
commit 2c3ea647fc

@ -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
#

@ -0,0 +1,26 @@
From e1a3e0d6f21507bc6f6ccb2e50a03c19872ff04b Mon Sep 17 00:00:00 2001
From: Victor Seva <linuxmaniac@torreviejawireless.org>
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
Loading…
Cancel
Save