summaryrefslogtreecommitdiff
path: root/libopie2/opienet/opcap.cpp
authormickeyl <mickeyl>2004-05-01 16:13:43 (UTC)
committer mickeyl <mickeyl>2004-05-01 16:13:43 (UTC)
commitd5abd7878f553f5ac0a41966b27f4c09389d3cfd (patch) (unidiff)
tree3140d1d1fe012c03c6c26bc587faeea5501f0b28 /libopie2/opienet/opcap.cpp
parent5a64ec5a21bb254c0e6a57e379cd1afc25259f19 (diff)
downloadopie-d5abd7878f553f5ac0a41966b27f4c09389d3cfd.zip
opie-d5abd7878f553f5ac0a41966b27f4c09389d3cfd.tar.gz
opie-d5abd7878f553f5ac0a41966b27f4c09389d3cfd.tar.bz2
- fix off-by-one bug in OChannelHopper
- fix bug in OPacket which broke everything using it - expose both wireless extension versions (runtime + compile time) through API
Diffstat (limited to 'libopie2/opienet/opcap.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--libopie2/opienet/opcap.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/libopie2/opienet/opcap.cpp b/libopie2/opienet/opcap.cpp
index f8ebe6b..a9dc577 100644
--- a/libopie2/opienet/opcap.cpp
+++ b/libopie2/opienet/opcap.cpp
@@ -58,9 +58,9 @@ OPacket::OPacket( int datalink, packetheaderstruct header, const unsigned char*
58 :QObject( parent, "Generic" ), _hdr( header ), _data( 0 ) 58 :QObject( parent, "Generic" ), _hdr( header ), _data( 0 )
59{ 59{
60 60
61 _data = new unsigned char[sizeof data]; 61 _data = new unsigned char[ header.len ];
62 assert( _data ); 62 assert( _data );
63 memcpy( const_cast<unsigned char*>(_data), data, sizeof data ); 63 memcpy( const_cast<unsigned char*>(_data), data, header.len );
64 // We have to copy the data structure here, because the 'data' pointer handed by libpcap 64 // We have to copy the data structure here, because the 'data' pointer handed by libpcap
65 // points to an internal region which is reused by lipcap. 65 // points to an internal region which is reused by lipcap.
66 odebug << "OPacket: Length = " << header.len << ", Caplen = " << header.caplen << oendl; 66 odebug << "OPacket: Length = " << header.len << ", Caplen = " << header.caplen << oendl;