Skip to content

Commit

Permalink
Fix for #446, this change will fix the crash for when a user specifie…
Browse files Browse the repository at this point in the history
…s a too long device name

Signed-off-by: Eivind Næss <[email protected]>
  • Loading branch information
enaess committed Sep 19, 2023
1 parent f5aa69b commit a68681d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions pppd/plugins/pppoe/if.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
Expand Down Expand Up @@ -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) {
Expand Down

0 comments on commit a68681d

Please sign in to comment.