From 3a5421b0fa24325b9d413df0c8811df836b04754 Mon Sep 17 00:00:00 2001 From: Greg Kroah-Hartman Date: Thu, 7 Mar 2019 17:06:01 +0100 Subject: [PATCH] 4.9-stable patches added patches: ncpfs-fix-build-warning-of-strncpy.patch --- .../ncpfs-fix-build-warning-of-strncpy.patch | 41 +++++++++++++++++++ queue-4.9/series | 1 + 2 files changed, 42 insertions(+) create mode 100644 queue-4.9/ncpfs-fix-build-warning-of-strncpy.patch diff --git a/queue-4.9/ncpfs-fix-build-warning-of-strncpy.patch b/queue-4.9/ncpfs-fix-build-warning-of-strncpy.patch new file mode 100644 index 00000000000..f3d2c34c25c --- /dev/null +++ b/queue-4.9/ncpfs-fix-build-warning-of-strncpy.patch @@ -0,0 +1,41 @@ +From foo@baz Thu Mar 7 17:02:50 CET 2019 +Date: Thu, 07 Mar 2019 17:02:50 +0100 +To: Greg KH +From: Greg Kroah-Hartman +Subject: ncpfs: fix build warning of strncpy + +From: Greg Kroah-Hartman + +Not upstream as ncpfs is long deleted. + +Fix up two strncpy build warnings in ncp_get_charsets() by using strscpy +and the max size of the array. + +It's not like anyone uses this code anyway, and this gets rid of two +build warnings so that we can see real warnings as they pop up over +time. + +Signed-off-by: Greg Kroah-Hartman + +diff --git a/fs/ncpfs/ioctl.c b/fs/ncpfs/ioctl.c +index 0a3f9b594602..37779ed3f790 100644 +--- a/fs/ncpfs/ioctl.c ++++ b/fs/ncpfs/ioctl.c +@@ -233,7 +233,7 @@ ncp_get_charsets(struct ncp_server* server, struct ncp_nls_ioctl __user *arg) + len = strlen(server->nls_vol->charset); + if (len > NCP_IOCSNAME_LEN) + len = NCP_IOCSNAME_LEN; +- strncpy(user.codepage, server->nls_vol->charset, len); ++ strscpy(user.codepage, server->nls_vol->charset, NCP_IOCSNAME_LEN); + user.codepage[len] = 0; + } + +@@ -243,7 +243,7 @@ ncp_get_charsets(struct ncp_server* server, struct ncp_nls_ioctl __user *arg) + len = strlen(server->nls_io->charset); + if (len > NCP_IOCSNAME_LEN) + len = NCP_IOCSNAME_LEN; +- strncpy(user.iocharset, server->nls_io->charset, len); ++ strscpy(user.iocharset, server->nls_io->charset, NCP_IOCSNAME_LEN); + user.iocharset[len] = 0; + } + mutex_unlock(&server->root_setup_lock); diff --git a/queue-4.9/series b/queue-4.9/series index ace2f106dc7..db9ef68adb1 100644 --- a/queue-4.9/series +++ b/queue-4.9/series @@ -2,3 +2,4 @@ usb-serial-option-add-telit-me910-ecm-composition.patch usb-serial-cp210x-add-id-for-ingenico-3070.patch usb-serial-ftdi_sio-add-id-for-hjelmslund-electronics-usb485.patch cpufreq-use-struct-kobj_attribute-instead-of-struct-global_attr.patch +ncpfs-fix-build-warning-of-strncpy.patch -- 2.47.2