From 05b76911ab2082436c577c1461f0d1210ce0aa33 Mon Sep 17 00:00:00 2001 From: mickeyl Date: Wed, 16 Apr 2003 13:19:32 +0000 Subject: add sanity check for last packet when capturing from capture file --- (limited to 'libopie2') diff --git a/libopie2/opienet/opcap.cpp b/libopie2/opienet/opcap.cpp index 04b1bb1..e362883 100644 --- a/libopie2/opienet/opcap.cpp +++ b/libopie2/opienet/opcap.cpp @@ -828,7 +828,7 @@ OPacket* OPacketCapturer::next() if ( _pcd ) pcap_dump( (u_char*) _pcd, &header, pdata ); - if ( header.len ) + if ( pdata && header.len ) { OPacket* p = new OPacket( dataLink(), header, pdata, 0 ); // packets shouldn't be inserted in the QObject child-parent hierarchy, @@ -842,6 +842,7 @@ OPacket* OPacketCapturer::next() } else { + qWarning( "OPacketCapturer::next() - no packet received!" ); return 0; } } -- cgit v0.9.0.2