summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDenis Ovsienko <denis@ovsienko.info>2023-01-02 15:06:49 +0000
committerDenis Ovsienko <denis@ovsienko.info>2023-01-02 15:06:49 +0000
commit5d055cc10560d8df19109be844ef45ee79a8086d (patch)
tree8d5cd4ae7381e05cf45fb5b697b0e5505bb55322
parent1f3650863b97f6f3d62db2b524de3ba61ffadf6b (diff)
downloadlibpcap-5d055cc10560d8df19109be844ef45ee79a8086d.tar.gz
Revert "Fix NULL pointer dereference in snf_read()"
As Guy points out, in this context the variable p never is NULL. This reverts commit 1f3650863b97f6f3d62db2b524de3ba61ffadf6b.
-rw-r--r--CHANGES1
-rw-r--r--CREDITS1
-rw-r--r--pcap-snf.c3
3 files changed, 1 insertions, 4 deletions
diff --git a/CHANGES b/CHANGES
index c0108231..483e0be2 100644
--- a/CHANGES
+++ b/CHANGES
@@ -3,7 +3,6 @@ Monthday, Month DD, YYYY:
Source code:
Use C99 fixed-width integer types, rather than self-defined
fixed-width integer types, in rpcap code.
- pcap-snf.c: Fix NULL pointer dereference in snf_read()
Link-layer types:
Add LINKTYPE_ETW/DLT_ETW.
Add LINKTYPE_NETANALYZER_NG/DLT_NETANALYZER_NG (pull request
diff --git a/CREDITS b/CREDITS
index b4b2b5df..08c650b6 100644
--- a/CREDITS
+++ b/CREDITS
@@ -70,7 +70,6 @@ Additional people who have contributed patches (in alphabetical order):
Dustin Spicuzza <dustin at virtualroadside dot com>
dzejarczech <dzejarczech at sourceforge dot net>
Edward Sheldrake <ejs1920 at sourceforge dot net>
- Ege Cetin <egecetin at hotmail dot com dot tr>
Eric Anderson <anderse at hpl dot hp dot com>
Erik de Castro Lopo <erik dot de dot castro dot lopo at sensorynetworks dot com>
Fedor Sakharov <fedor dot sakharov at gmail dot com>
diff --git a/pcap-snf.c b/pcap-snf.c
index 2503c707..b885e026 100644
--- a/pcap-snf.c
+++ b/pcap-snf.c
@@ -131,7 +131,7 @@ snf_timestamp_to_timeval(const int64_t ts_nanosec, const int tstamp_precision)
static int
snf_read(pcap_t *p, int cnt, pcap_handler callback, u_char *user)
{
- struct pcap_snf *ps;
+ struct pcap_snf *ps = p->priv;
struct pcap_pkthdr hdr;
int i, flags, err, caplen, n;
struct snf_recv_req req;
@@ -139,7 +139,6 @@ snf_read(pcap_t *p, int cnt, pcap_handler callback, u_char *user)
if (!p)
return -1;
- ps = p->priv;
/*
* This can conceivably process more than INT_MAX packets,