aboutsummaryrefslogtreecommitdiffstats
path: root/io.c
diff options
context:
space:
mode:
authorArnold D. Robbins <arnold@skeeve.com>2016-03-13 20:21:00 +0200
committerArnold D. Robbins <arnold@skeeve.com>2016-04-04 06:35:54 +0300
commit124c3594cb65748ce858dcc55eadd7c831cee041 (patch)
treee31cf88a4231a756e63dd9350ff54d326e7ae331 /io.c
parent7a1dafd29d4ec5d8868f5ea376a99422a9282cdb (diff)
downloadegawk-124c3594cb65748ce858dcc55eadd7c831cee041.tar.gz
egawk-124c3594cb65748ce858dcc55eadd7c831cee041.tar.bz2
egawk-124c3594cb65748ce858dcc55eadd7c831cee041.zip
Initial fix for use of closed end of two-way connection.
Diffstat (limited to 'io.c')
-rw-r--r--io.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/io.c b/io.c
index d4435684..de753973 100644
--- a/io.c
+++ b/io.c
@@ -2473,6 +2473,8 @@ do_getline_redir(int into_variable, enum redirval redirtype)
update_ERRNO_int(redir_error);
}
return make_number((AWKNUM) -1.0);
+ } else if ((rp->flag & RED_TWOWAY) != 0 && rp->iop == NULL) {
+ fatal(_("getline: attempt to read from closed read end of two-way pipe"));
}
iop = rp->iop;
if (iop == NULL) /* end of input */