forked from osmocom/wireshark
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>
This commit is contained in:
parent
b223d649fe
commit
50591ac861
|
@ -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);
|
||||
|
|
Loading…
Reference in New Issue