summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDenis Ovsienko <denis@ovsienko.info>2023-01-02 15:11:12 +0000
committerDenis Ovsienko <denis@ovsienko.info>2023-01-02 15:11:12 +0000
commit3ba53bfd192764f5a6b681ccd2aa70b42f968650 (patch)
tree830a85ee243fe37da7bdcb8faf87d479f79d5889
parent5d055cc10560d8df19109be844ef45ee79a8086d (diff)
downloadlibpcap-3ba53bfd192764f5a6b681ccd2aa70b42f968650.tar.gz
Remove an always-false pointer test from snf_read().
Guy Harris: "The only way snf_read() gets called is through the read_op function pointer in the pcap_t, so the only way it gets called is if you have a non-NULL pcap_t * pointing to a pcap_t with a read_op set to snf_read()."
-rw-r--r--CHANGES1
-rw-r--r--pcap-snf.c3
2 files changed, 1 insertions, 3 deletions
diff --git a/CHANGES b/CHANGES
index 483e0be2..1d249f67 100644
--- a/CHANGES
+++ b/CHANGES
@@ -3,6 +3,7 @@ Monthday, Month DD, YYYY:
Source code:
Use C99 fixed-width integer types, rather than self-defined
fixed-width integer types, in rpcap code.
+ Remove an always-false pointer test from snf_read().
Link-layer types:
Add LINKTYPE_ETW/DLT_ETW.
Add LINKTYPE_NETANALYZER_NG/DLT_NETANALYZER_NG (pull request
diff --git a/pcap-snf.c b/pcap-snf.c
index b885e026..95a64ac0 100644
--- a/pcap-snf.c
+++ b/pcap-snf.c
@@ -137,9 +137,6 @@ snf_read(pcap_t *p, int cnt, pcap_handler callback, u_char *user)
struct snf_recv_req req;
int nonblock, timeout;
- if (!p)
- return -1;
-
/*
* This can conceivably process more than INT_MAX packets,
* which would overflow the packet count, causing it either