aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorToni <matzeton@googlemail.com>2020-11-26 19:46:31 +0100
committerGitHub <noreply@github.com>2020-11-26 19:46:31 +0100
commitdaa1c8ef8c8a61899bf3d311f7efa11c090bfe70 (patch)
tree01913f51e8c9b5421fde40c220cb8bb37cb57a03 /src
parent7437ecaab02a893ae9fb43ca193f0d184ed5a3ea (diff)
Fix/overflow and libgerror check (#1068)
* Fixed stack overflow caused by missing buffer space for the trailing \0 added by sprintf() Signed-off-by: Toni Uhlig <matzeton@googlemail.com> * Remove the autoconf cache value from the previous and failed check before checking again. Signed-off-by: Toni Uhlig <matzeton@googlemail.com>
Diffstat (limited to 'src')
-rw-r--r--src/lib/ndpi_utils.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/lib/ndpi_utils.c b/src/lib/ndpi_utils.c
index edf7ebd07..53f8019dd 100644
--- a/src/lib/ndpi_utils.c
+++ b/src/lib/ndpi_utils.c
@@ -1139,7 +1139,7 @@ int ndpi_dpi2json(struct ndpi_detection_module_struct *ndpi_struct,
case NDPI_PROTOCOL_BITTORRENT:
{
u_int i, j, n = 0;
- char bittorent_hash[32];
+ char bittorent_hash[sizeof(flow->protos.bittorrent.hash)*2+1];
for(i=0, j = 0; j < sizeof(bittorent_hash)-1; i++) {
sprintf(&bittorent_hash[j], "%02x",