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 23fa1b3272)
This commit is contained in:
Thomas Haller 2019-08-02 11:43:54 +02:00
parent 7d603b7e35
commit 115184f5bd

View file

@ -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;