nl80211: fix possibly unterminated ifname string
authorJo-Philipp Wich <jow@openwrt.org>
Thu, 29 Oct 2015 09:53:56 +0000 (10:53 +0100)
committerJo-Philipp Wich <jow@openwrt.org>
Thu, 29 Oct 2015 09:53:56 +0000 (10:53 +0100)
Signed-off-by: Jo-Philipp Wich <jow@openwrt.org>
iwinfo_nl80211.c

index a08d5807edf0ae1e347098ba22c0ff179b3d9ca4..1a1fc69db4f15f1cb4685f49bc4318db39f824b4 100644 (file)
@@ -604,7 +604,7 @@ static char * nl80211_phy2ifname(const char *ifname)
                                            ((ifidx < 0) || (cifidx < ifidx)))
                                        {
                                                ifidx = cifidx;
-                                               strncpy(nif, e->d_name, sizeof(nif));
+                                               strncpy(nif, e->d_name, sizeof(nif) - 1);
                                        }
                                }
                        }