summaryrefslogtreecommitdiff
path: root/Documentation/networking/tuntap.rst
diff options
context:
space:
mode:
authorKees Cook <keescook@chromium.org>2021-06-02 13:29:14 -0700
committerJonathan Corbet <corbet@lwn.net>2021-06-04 11:21:43 -0600
commitf9ce26c56d37fa6d32f700dfc77f4ceb445ce215 (patch)
treec568a0bfd717affc70d4d1b7892c1218dd0a5f58 /Documentation/networking/tuntap.rst
parent709dedfdf3daa8719240ecff1c0b70b278005386 (diff)
docs: networking: Replace strncpy() with strscpy()
Replace example code's use of strncpy() with strscpy() functions. Using strncpy() is considered deprecated: https://www.kernel.org/doc/html/latest/process/deprecated.html#strncpy-on-nul-terminated-strings Signed-off-by: Kees Cook <keescook@chromium.org> Acked-by: Dmitry Torokhov <dmitry.torokhov@gmail.com> Link: https://lore.kernel.org/r/20210602202914.4079123-1-keescook@chromium.org Signed-off-by: Jonathan Corbet <corbet@lwn.net>
Diffstat (limited to 'Documentation/networking/tuntap.rst')
-rw-r--r--Documentation/networking/tuntap.rst2
1 files changed, 1 insertions, 1 deletions
diff --git a/Documentation/networking/tuntap.rst b/Documentation/networking/tuntap.rst
index a59d1dd6fdcc..4d7087f727be 100644
--- a/Documentation/networking/tuntap.rst
+++ b/Documentation/networking/tuntap.rst
@@ -107,7 +107,7 @@ Note that the character pointer becomes overwritten with the real device name
*/
ifr.ifr_flags = IFF_TUN;
if( *dev )
- strncpy(ifr.ifr_name, dev, IFNAMSIZ);
+ strscpy_pad(ifr.ifr_name, dev, IFNAMSIZ);
if( (err = ioctl(fd, TUNSETIFF, (void *) &ifr)) < 0 ){
close(fd);