Comments (6)
Commit bf2270d addressed NULL termination part of this report in 2002.
from libpcap.
strlcpy()
, which boils to strncpy()
with NULL termination enforced, isn't portable. For example, my Linux host doesn't include it. There is an article explaining that just having strlcpy()
in the code doesn't result in guaranteed security: http://lwn.net/Articles/507319/
A sufficient scope of this request would be to check that all strncpy()
instances handle NULL termination.
from libpcap.
There were already some strlcpy()
s in pcap-linux.c; I converted the remainder of them to fix some Coverity issues. We have a fallback version of snprintf()
; we should perhaps have a fallback version of strlcpy()
as well, just as tcpdump does.
The strncpy()
s and strcpy()
s I converted are for ioctls on the interface; we should probably check, in the create routine on Linux, whether the name passed in is too big for those ioctls and, if so, return "no such device" (because the Linux kernel presumably won't create network interfaces whose names won't fit in those ioctls - if it does, that's a kernel bug).
from libpcap.
we should probably check, in the create routine on Linux, whether the name passed in is too big for those ioctls and, if so, return "no such device"
Or in the activate routine; I've added that check in 1099050.
from libpcap.
pcap-int.h
has
#ifndef HAVE_STRLCPY
#define strlcpy(x, y, z) \
(strncpy((x), (y), (z)), \
((z) <= 0 ? 0 : ((x)[(z) - 1] = '\0')), \
strlen((y)))
#endif
and the libpcap configure script checks for strlcpy()
, so if it's missing, we have a macro that does the right thing using strncpy()
.
from libpcap.
we should probably check, in the create routine on Linux, whether the name passed in is too big for those ioctls and, if so, return "no such device"
Or in the activate routine; I've added that check in 1099050.
Done in pcap-bpf.c as well, with various commits.
I'll look at cleaning up the (ancient) remaining code that's using strncpy()
.
from libpcap.
Related Issues (20)
- Simple filter of 1000 hosts takes O(nĀ²) to compile HOT 3
- libpcap can't read pcapng files with more than one link-layer type HOT 18
- Remove pcap-rpcap-int.h? HOT 2
- Optimizer does not completely remove leading noop statements
- test programs do not work well when the only capture devices are non-network HOT 7
- haiku: Some warning should be fixed HOT 8
- configure:3855: gcc -V >&5 gcc: error: unrecognized command line option '-V' HOT 12
- Can't filter vlan and geneve packet HOT 17
- libpcap can print to standard error under certain conditions HOT 1
- build fails on AIX 7.1 due to thread-local storage HOT 4
- Clang build on OpenIndiana 2023.10 is broken HOT 3
- go RPCAP protocol implementation comparison with the source code here? HOT 7
- SSL support for Windows when compiling libpcap? HOT 2
- ibv_open_device() not called before ibv_free_device_list()? HOT 1
- rpcapd-config additional field additionals for future from examples found online
- Confirmation and clarification of TLS handling and user authentication for rpcap HOT 1
- Does libpcap support writing pcapng format? HOT 2
- disabling NETIF_F_HW_VLAN_CTAG_TX issue HOT 3
- Accessing Decryption Secrets Block (DSB) HOT 2
- libpcap should fully support pcapng files HOT 24
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
š Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. ššš
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ā¤ļø Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from libpcap.