X-Git-Url: https://git.ozlabs.org/?a=blobdiff_plain;f=pppd%2Fplugins%2Fpppoe%2Fif.c;h=4b13ecc19866eed617fa8ce038d8b2b728ceeba2;hb=91b203f5f2ae01e477438fb5583fddc978cfed99;hp=87e5f6ec87921e1dd93fff200b2d1d78a1a8d314;hpb=f5aa69baefa83c1d9316f5736c2b6521eff44a81;p=ppp.git diff --git a/pppd/plugins/pppoe/if.c b/pppd/plugins/pppoe/if.c index 87e5f6e..4b13ecc 100644 --- a/pppd/plugins/pppoe/if.c +++ b/pppd/plugins/pppoe/if.c @@ -175,7 +175,7 @@ openInterface(char const *ifname, UINT16_t type, unsigned char *hwaddr) sa.sll_ifindex = ifr.ifr_ifindex; #else - strcpy(sa.sa_data, ifname); + strlcpy(sa.sa_data, ifname, sizeof(sa.sa_data)); #endif /* We're only interested in packets on specified interface */ @@ -212,7 +212,7 @@ sendPacket(PPPoEConnection *conn, int sock, PPPoEPacket *pkt, int size) #else struct sockaddr sa; - strcpy(sa.sa_data, conn->ifName); + strlcpy(sa.sa_data, conn->ifName, sizeof(sa.sa_data)); err = sendto(sock, pkt, size, 0, &sa, sizeof(sa)); #endif if (err < 0) {