aboutsummaryrefslogtreecommitdiff
path: root/src/lib/ndpi_utils.c
diff options
context:
space:
mode:
authorLuca Deri <deri@ntop.org>2023-09-05 18:08:16 +0200
committerLuca Deri <deri@ntop.org>2023-09-05 18:08:16 +0200
commitad9ed4f95480d6cd093ee259d520cf802fec7ed2 (patch)
tree0bebb2e8957098d8248073debf8d16394a68aceb /src/lib/ndpi_utils.c
parent978df906b38c26a359b2d91089e70e133cc7502e (diff)
Minor warning fixes
Diffstat (limited to 'src/lib/ndpi_utils.c')
-rw-r--r--src/lib/ndpi_utils.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/lib/ndpi_utils.c b/src/lib/ndpi_utils.c
index b58fce522..854b548f0 100644
--- a/src/lib/ndpi_utils.c
+++ b/src/lib/ndpi_utils.c
@@ -1274,7 +1274,9 @@ int ndpi_dpi2json(struct ndpi_detection_module_struct *ndpi_struct,
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",
+ snprintf(&bittorent_hash[j],
+ sizeof(bittorent_hash) - j,
+ "%02x",
flow->protos.bittorrent.hash[i]);
j += 2, n += flow->protos.bittorrent.hash[i];