From d5abd7878f553f5ac0a41966b27f4c09389d3cfd Mon Sep 17 00:00:00 2001 From: mickeyl Date: Sat, 01 May 2004 16:13:43 +0000 Subject: - 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 --- (limited to 'libopie2/opienet/opcap.cpp') 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* :QObject( parent, "Generic" ), _hdr( header ), _data( 0 ) { - _data = new unsigned char[sizeof data]; + _data = new unsigned char[ header.len ]; assert( _data ); - memcpy( const_cast(_data), data, sizeof data ); + memcpy( const_cast(_data), data, header.len ); // We have to copy the data structure here, because the 'data' pointer handed by libpcap // points to an internal region which is reused by lipcap. odebug << "OPacket: Length = " << header.len << ", Caplen = " << header.caplen << oendl; -- cgit v0.9.0.2