summaryrefslogtreecommitdiff
path: root/ui
diff options
context:
space:
mode:
authorMartin Kaiser <wireshark@kaiser.cx>2016-06-15 19:53:45 -0700
committerAnders Broman <a.broman58@gmail.com>2016-06-16 04:38:53 +0000
commit50591ac8612abdba23cfb5089b06e38a26e13bc9 (patch)
treecb8f728672d0bedd71f2798fd4754b3b672c6f8b /ui
parentb223d649fed632d10b356f66c3a286740cec9e7d (diff)
downloadwireshark-50591ac8612abdba23cfb5089b06e38a26e13bc9.tar.gz
CID 1250642: check the return value of dup()
abort if it is -1 Change-Id: Ie14c18679ff74529731558d6742f63ebfb9fe97b Reviewed-on: https://code.wireshark.org/review/15958 Petri-Dish: Anders Broman <a.broman58@gmail.com> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Anders Broman <a.broman58@gmail.com>
Diffstat (limited to 'ui')
-rw-r--r--ui/qt/follow_stream_dialog.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/ui/qt/follow_stream_dialog.cpp b/ui/qt/follow_stream_dialog.cpp
index 4da52e5fd3..811365e0b4 100644
--- a/ui/qt/follow_stream_dialog.cpp
+++ b/ui/qt/follow_stream_dialog.cpp
@@ -496,7 +496,10 @@ void FollowStreamDialog::addText(QString text, gboolean is_from_server, guint32
{
size_t nwritten;
int FileDescriptor = file_.handle();
- FILE* fh = ws_fdopen(ws_dup(FileDescriptor), "wb");
+ int fd_new = ws_dup(FileDescriptor);
+ if (fd_new == -1)
+ return;
+ FILE* fh = ws_fdopen(fd_new, "wb");
if (show_type_ == SHOW_RAW) {
QByteArray binstream = QByteArray::fromHex(text.toUtf8());
nwritten = fwrite(binstream.constData(), binstream.length(), 1, fh);