From ad9ed4f95480d6cd093ee259d520cf802fec7ed2 Mon Sep 17 00:00:00 2001 From: Luca Deri Date: Tue, 5 Sep 2023 18:08:16 +0200 Subject: Minor warning fixes --- src/lib/ndpi_utils.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src/lib/ndpi_utils.c') 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]; -- cgit v1.2.3