Source-Changes-D archive

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

Re: CVS commit: src/usr.sbin/altq/altqstat



On Fri, Feb 07, 2020 at 20:13:26 +0000, Santhosh Raju wrote:

> Module Name:	src
> Committed By:	fox
> Date:		Fri Feb  7 20:13:26 UTC 2020
> 
> Modified Files:
> 	src/usr.sbin/altq/altqstat: quip_client.c
> 
> Log Message:
> usr.sbin/altq: Fix -Wstringop-truncation warning.
> 
> Looks like the original intention was to truncate the string at len.
> 
> Replace strncpy(3) with strlcpy(3).
> 
> Error was reported when build.sh was run with MKLIBCSANITIZER=yes flag.
> 
> Reviewed by: kamil@

This looks half-baked.  It still uses 63 to cap len (64-1 to accout
for strncpy), when the buffer is 64.

It wants to cap len precisely b/c it used strncpy.  The new strlcpy
code should not do it b/c strlcpy doesn't pad the destination.

-uwe


Home | Main Index | Thread Index | Old Index