diff options
author | Guy Harris <guy@alum.mit.edu> | 2014-04-04 12:25:01 -0700 |
---|---|---|
committer | Guy Harris <guy@alum.mit.edu> | 2014-04-04 12:25:01 -0700 |
commit | 39ec2e4012ae5f585ac231dc1db47361df200670 (patch) | |
tree | cc4e532b17ff2a67b6729ddd6da87e31ee71bdc4 /pcap-linux.c | |
parent | cdf8b96d21e26b5fe8f9f38ae1b3ee164b839fdc (diff) |
And another strlcpy().
This one replaces a strcpy(); that one was also found by Coverity.
(I suppose we should check whether strlcpy() prematurely null-terminates
the string, and report a "no such device" error - or, in the create
routine, check to make sure the device name fits within all of the
relevant ioctl data structures and, if not, return a "device doesn't
exist" error.)
Diffstat (limited to 'pcap-linux.c')
-rw-r--r-- | pcap-linux.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/pcap-linux.c b/pcap-linux.c index fa0dc4b0..8ab8d5ab 100644 --- a/pcap-linux.c +++ b/pcap-linux.c @@ -3758,7 +3758,7 @@ create_ring(pcap_t *handle, int *status) hwconfig.rx_filter = HWTSTAMP_FILTER_ALL; memset(&ifr, 0, sizeof(ifr)); - strcpy(ifr.ifr_name, handle->opt.source); + strlcpy(ifr.ifr_name, handle->opt.source, sizeof(ifr.ifr_name)); ifr.ifr_data = (void *)&hwconfig; if (ioctl(handle->fd, SIOCSHWTSTAMP, &ifr) < 0) { |