author | mickeyl <mickeyl> | 2003-04-16 13:20:06 (UTC) |
---|---|---|
committer | mickeyl <mickeyl> | 2003-04-16 13:20:06 (UTC) |
commit | be5832dc22255be38884e352917f48d5b71ae657 (patch) (unidiff) | |
tree | eedcdeecb13bd873788fa53599a682b730c3286f | |
parent | 05b76911ab2082436c577c1461f0d1210ce0aa33 (diff) | |
download | opie-be5832dc22255be38884e352917f48d5b71ae657.zip opie-be5832dc22255be38884e352917f48d5b71ae657.tar.gz opie-be5832dc22255be38884e352917f48d5b71ae657.tar.bz2 |
fix segfault after last packet when capturing from capture file
-rw-r--r-- | noncore/net/wellenreiter/gui/wellenreiter.cpp | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/noncore/net/wellenreiter/gui/wellenreiter.cpp b/noncore/net/wellenreiter/gui/wellenreiter.cpp index b4b6aa3..0105e09 100644 --- a/noncore/net/wellenreiter/gui/wellenreiter.cpp +++ b/noncore/net/wellenreiter/gui/wellenreiter.cpp | |||
@@ -370,20 +370,27 @@ void Wellenreiter::startClicked() | |||
370 | logwindow->log( "(i) Started Scanning." ); | 370 | logwindow->log( "(i) Started Scanning." ); |
371 | sniffing = true; | 371 | sniffing = true; |
372 | emit( startedSniffing() ); | 372 | emit( startedSniffing() ); |
373 | if ( cardtype != DEVTYPE_FILE ) channelHopped( 6 ); // set title | 373 | if ( cardtype != DEVTYPE_FILE ) channelHopped( 6 ); // set title |
374 | else | 374 | else |
375 | { | 375 | { |
376 | assert( parent() ); | 376 | assert( parent() ); |
377 | ( (QMainWindow*) parent() )->setCaption( "Wellenreiter II - replaying capture file..." ); | 377 | ( (QMainWindow*) parent() )->setCaption( "Wellenreiter II - replaying capture file..." ); |
378 | } | 378 | } |
379 | } | 379 | } |
380 | 380 | ||
381 | 381 | ||
382 | void Wellenreiter::timerEvent( QTimerEvent* ) | 382 | void Wellenreiter::timerEvent( QTimerEvent* ) |
383 | { | 383 | { |
384 | qDebug( "Wellenreiter::timerEvent()" ); | 384 | qDebug( "Wellenreiter::timerEvent()" ); |
385 | OPacket* p = pcap->next(); | 385 | OPacket* p = pcap->next(); |
386 | receivePacket( p ); | 386 | if ( !p ) // no more packets available |
387 | delete p; | 387 | { |
388 | stopClicked(); | ||
389 | } | ||
390 | else | ||
391 | { | ||
392 | receivePacket( p ); | ||
393 | delete p; | ||
394 | } | ||
388 | } | 395 | } |
389 | 396 | ||