From 115184f5bd663046b6f4a2c62b6232e75aab24f8 Mon Sep 17 00:00:00 2001 From: Thomas Haller Date: Fri, 2 Aug 2019 11:43:54 +0200 Subject: [PATCH] adsl: avoid coverity false-positive when using strcpy() for interface name CID 59391 (#1 of 1): Copy into fixed size buffer (STRING_OVERFLOW) 31. fixed_size_dest: You might overrun the 16-character fixed-size string be.ifspec.spec.ifname by copying priv->nas_ifname without checking the length. (cherry picked from commit 23fa1b3272f5af3520c619f2d4101dcc2fbbf914) --- src/devices/adsl/nm-device-adsl.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/devices/adsl/nm-device-adsl.c b/src/devices/adsl/nm-device-adsl.c index 536d7cccb7..34efdb0156 100644 --- a/src/devices/adsl/nm-device-adsl.c +++ b/src/devices/adsl/nm-device-adsl.c @@ -207,7 +207,7 @@ br2684_assign_vcc (NMDeviceAdsl *self, NMSettingAdsl *s_adsl) memset (&be, 0, sizeof (be)); be.backend_num = ATM_BACKEND_BR2684; be.ifspec.method = BR2684_FIND_BYIFNAME; - strcpy (be.ifspec.spec.ifname, priv->nas_ifname); + nm_utils_ifname_cpy (be.ifspec.spec.ifname, priv->nas_ifname); be.fcs_in = BR2684_FCSIN_NO; be.fcs_out = BR2684_FCSOUT_NO; be.encaps = is_llc ? BR2684_ENCAPS_LLC : BR2684_ENCAPS_VC;