ntop / nDPI

Open Source Deep Packet Inspection Software Toolkit
http://www.ntop.org
GNU Lesser General Public License v3.0
3.86k stars 902 forks source link

Fix builds on Windows #2580

Closed IvanNardi closed 2 months ago

IvanNardi commented 2 months ago

Quick fix with latest Windows image on GitHub CI, where we got:

 ndpiReader.c:2860:38: error: '%s' directive output may be truncated writing up to 64 bytes into a region of size 63 [-Werror=format-truncation=]
 2860 |     snprintf(srcip, sizeof(srcip), "[%s]", flow->src_name);
      |                                      ^~
ndpiReader.c:2860:5: note: 'snprintf' output between 3 and 67 bytes into a destination of size 64
 2860 |     snprintf(srcip, sizeof(srcip), "[%s]", flow->src_name);
      |     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
ndpiReader.c:2861:38: error: '%s' directive output may be truncated writing up to 64 bytes into a region of size 63 [-Werror=format-truncation=]
 2861 |     snprintf(dstip, sizeof(dstip), "[%s]", flow->dst_name);
      |                                      ^~
ndpiReader.c:2861:5: note: 'snprintf' output between 3 and 67 bytes into a destination of size 64
 2861 |     snprintf(dstip, sizeof(dstip), "[%s]", flow->dst_name);
      |     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
sonarcloud[bot] commented 2 months ago

Quality Gate Passed Quality Gate passed

Issues
0 New issues
0 Accepted issues

Measures
0 Security Hotspots
0.0% Coverage on New Code
0.0% Duplication on New Code

See analysis details on SonarCloud