summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKen Brown <kbrown@cornell.edu>2019-03-25 23:06:09 +0000
committerCorinna Vinschen <corinna@vinschen.de>2019-03-27 14:01:45 +0100
commit40db74128ad2ed2431cd67f1c14ab50d4859d4df (patch)
tree558e5036e084dc6e8b8308b1898f81e772f1adb7
parentee394c311e493ba8e23516a2ba72cadf3d9eaf9a (diff)
downloadcygnal-40db74128ad2ed2431cd67f1c14ab50d4859d4df.tar.gz
cygnal-40db74128ad2ed2431cd67f1c14ab50d4859d4df.tar.bz2
cygnal-40db74128ad2ed2431cd67f1c14ab50d4859d4df.zip
Cygwin: FIFO: avoid crashes when cloning a client
fhandler_fifo::clone called fhandler_base::clone on each client fhandler. But those fhandlers are actually fhandler_fifo objects, so when fhandler_base::clone calls copyto, it's actually fhandler_fifo::copyto that gets called. This can lead to mysterious crashes. Fix this by simply calling clone (which translates to fhandler_fifo::clone) on each client fhandler.
-rw-r--r--winsup/cygwin/fhandler.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/winsup/cygwin/fhandler.h b/winsup/cygwin/fhandler.h
index f6982f0ba..ef34f9c40 100644
--- a/winsup/cygwin/fhandler.h
+++ b/winsup/cygwin/fhandler.h
@@ -1316,7 +1316,7 @@ public:
fhandler_fifo *fhf = new (ptr) fhandler_fifo (ptr);
copyto (fhf);
for (int i = 0; i < nclients; i++)
- fhf->client[i].fh = client[i].fh->fhandler_base::clone ();
+ fhf->client[i].fh = client[i].fh->clone ();
return fhf;
}
};