diff options
author | Johan Hedberg <johan.hedberg@nokia.com> | 2009-02-25 17:34:16 +0200 |
---|---|---|
committer | Johan Hedberg <johan.hedberg@nokia.com> | 2009-02-25 17:34:16 +0200 |
commit | d7aa6d1b2d6f3fc48b8287ea04c741078b22f2da (patch) | |
tree | deb3d94a1fd72668ba7a6454c7474396ed4b82e4 /network/common.c | |
parent | 295727e0425b0ac1561883e2a273f65b4b6450a4 (diff) |
Use safer strncpy instead of strcpy
Diffstat (limited to 'network/common.c')
-rw-r--r-- | network/common.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/network/common.c b/network/common.c index c92baf0c..371d74bf 100644 --- a/network/common.c +++ b/network/common.c @@ -262,7 +262,7 @@ int bnep_if_up(const char *devname, uint16_t id) sd = socket(AF_INET6, SOCK_DGRAM, 0); memset(&ifr, 0, sizeof(ifr)); - strcpy(ifr.ifr_name, devname); + strncpy(ifr.ifr_name, devname, IF_NAMESIZE); ifr.ifr_flags |= IFF_UP; ifr.ifr_flags |= IFF_MULTICAST; @@ -352,7 +352,7 @@ int bnep_if_down(const char *devname) done: sd = socket(AF_INET6, SOCK_DGRAM, 0); memset(&ifr, 0, sizeof(ifr)); - strcpy(ifr.ifr_name, devname); + strncpy(ifr.ifr_name, devname, IF_NAMESIZE); ifr.ifr_flags &= ~IFF_UP; |