diff options
author | Toni Uhlig <matzeton@googlemail.com> | 2020-11-24 01:21:52 +0100 |
---|---|---|
committer | Toni Uhlig <matzeton@googlemail.com> | 2020-11-24 01:21:52 +0100 |
commit | db4443c0686e4220ee86e624f69040c54170b6a1 (patch) | |
tree | ca49e0942c091364d0401169e8d2ac2ed9bca506 | |
parent | 7437ecaab02a893ae9fb43ca193f0d184ed5a3ea (diff) |
Fixed stack overflow caused by missing buffer space for the trailing \0 added by sprintf()
Signed-off-by: Toni Uhlig <matzeton@googlemail.com>
-rw-r--r-- | src/lib/ndpi_utils.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/lib/ndpi_utils.c b/src/lib/ndpi_utils.c index edf7ebd07..cb68cc849 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[32+1]; for(i=0, j = 0; j < sizeof(bittorent_hash)-1; i++) { sprintf(&bittorent_hash[j], "%02x", |