qt: Fix crash when stopping an empty live capture
When the capture process has not yet received any packets (not even the libpcap header), Wireshark-Qt would crash because no valid capture file was found. Reproducer: ssh otherhost sleep 10000 | wireshark -k -i - GTK displays "Waiting for capture input data" in the status bar until the capture file format is determined. After this patch, both versions will just display an "Interrupted system call" message. Change-Id: I146f00c0f4fcab04cddcd4f29b56e97b807a9c40 Reviewed-on: https://code.wireshark.org/review/10388 Reviewed-by: Peter Wu <peter@lekensteyn.nl> Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com> Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com> Petri-Dish: Alexis La Goutte <alexis.lagoutte@gmail.com> Petri-Dish: Peter Wu <peter@lekensteyn.nl> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: ronnie sahlberg <ronniesahlberg@gmail.com>
This commit is contained in:
parent
df3fd2dc69
commit
fd342f7f73
|
@ -242,11 +242,13 @@ void MainStatusBar::expertUpdate() {
|
||||||
// ui/gtk/main_statusbar.c
|
// ui/gtk/main_statusbar.c
|
||||||
void MainStatusBar::setFileName(CaptureFile &cf)
|
void MainStatusBar::setFileName(CaptureFile &cf)
|
||||||
{
|
{
|
||||||
popFileStatus();
|
if (cf.isValid()) {
|
||||||
QString msgtip = QString("%1 (%2)")
|
popFileStatus();
|
||||||
.arg(cf.capFile()->filename)
|
QString msgtip = QString("%1 (%2)")
|
||||||
.arg(file_size_to_qstring(cf.capFile()->f_datalen));
|
.arg(cf.capFile()->filename)
|
||||||
pushFileStatus(cf.fileName(), msgtip);
|
.arg(file_size_to_qstring(cf.capFile()->f_datalen));
|
||||||
|
pushFileStatus(cf.fileName(), msgtip);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void MainStatusBar::setCaptureFile(capture_file *cf)
|
void MainStatusBar::setCaptureFile(capture_file *cf)
|
||||||
|
|
Loading…
Reference in New Issue