lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-Id: <20180702.224305.2266842641209029592.davem@davemloft.net>
Date:   Mon, 02 Jul 2018 22:43:05 +0900 (KST)
From:   David Miller <davem@...emloft.net>
To:     linux@...ck-us.net
Cc:     isdn@...ux-pingi.de, keescook@...omium.org,
        linux-kernel@...r.kernel.org, netdev@...r.kernel.org
Subject: Re: [PATCH] TTY: isdn: Replace strncpy with memcpy

From: Guenter Roeck <linux@...ck-us.net>
Date: Sun,  1 Jul 2018 13:57:38 -0700

> gcc 8.1.0 complains:
> 
> drivers/isdn/i4l/isdn_tty.c: In function 'isdn_tty_suspend.isra.1':
> drivers/isdn/i4l/isdn_tty.c:790:3: warning:
> 	'strncpy' output truncated before terminating nul copying
> 	as many bytes from a string as its length
> drivers/isdn/i4l/isdn_tty.c:778:6: note: length computed here
> 
> drivers/isdn/i4l/isdn_tty.c: In function 'isdn_tty_resume':
> drivers/isdn/i4l/isdn_tty.c:880:3: warning:
> 	'strncpy' output truncated before terminating nul copying
> 	as many bytes from a string as its length
> drivers/isdn/i4l/isdn_tty.c:817:6: note: length computed here
> 
> Using strncpy() is indeed less than perfect since the length of data to
> be copied has already been determined with strlen(). Replace strncpy()
> with memcpy() to address the warning and optimize the code a little.
> 
> Signed-off-by: Guenter Roeck <linux@...ck-us.net>

Applied.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ