Re: [PATCH V2 5/5] Tools: hv: kvp: Fix a warning of buffer overflow with gcc 8.0.1

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, Oct 18, 2018 at 05:09:32AM +0000, kys@xxxxxxxxxxxxxxxxx wrote:
> From: Dexuan Cui <decui@xxxxxxxxxxxxx>
> 
> The patch fixes:
> 
> hv_kvp_daemon.c: In function 'kvp_set_ip_info':
> hv_kvp_daemon.c:1305:2: note: 'snprintf' output between 41 and 4136 bytes
> into a destination of size 4096
> 
> The "(unsigned int)str_len" is to avoid:
> 
> hv_kvp_daemon.c:1309:30: warning: comparison of integer expressions of
> different signedness: 'int' and 'long unsigned int' [-Wsign-compare]
> 

Ugh...  Any tool with the most basic flow analysis would realize this
was a false positive.  We use at least three static analyzers which
catch signedness bugs.  Can we turn off GCC's warning on this until they
improve it a bit?

regards,
dan carpenter

_______________________________________________
devel mailing list
devel@xxxxxxxxxxxxxxxxxxxxxx
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel



[Index of Archives]     [Linux Driver Backports]     [DMA Engine]     [Linux GPIO]     [Linux SPI]     [Video for Linux]     [Linux USB Devel]     [Linux Coverity]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]
  Powered by Linux