diff options
author | Gurusamy Sarathy <gsar@cpan.org> | 1999-01-17 12:00:23 +0000 |
---|---|---|
committer | Gurusamy Sarathy <gsar@cpan.org> | 1999-01-17 12:00:23 +0000 |
commit | 06eaf0bc49fea082c8b8358680815d807a7a925e (patch) | |
tree | f4d9a1a3a6f0ef0ce15edc648b1335e1a3012c04 /doio.c | |
parent | a81cd81f8e04bbc8bb5b6ca8cd8516f6206c6912 (diff) | |
download | perl-06eaf0bc49fea082c8b8358680815d807a7a925e.tar.gz |
sanity check piped opens (tweaked version of patch suggested
by Mark-Jason Dominus)
p4raw-id: //depot/perl@2629
Diffstat (limited to 'doio.c')
-rw-r--r-- | doio.c | 14 |
1 files changed, 14 insertions, 0 deletions
@@ -188,6 +188,13 @@ do_open(GV *gv, register char *name, I32 len, int as_raw, int rawmode, int rawpe if (*name == '|') { /*SUPPRESS 530*/ for (name++; isSPACE(*name); name++) ; + if (*name == '\0') { /* command is missing 19990114 */ + dTHR; + if (ckWARN(WARN_PIPE)) + warner(WARN_PIPE, "Missing command in piped open"); + errno = EPIPE; + goto say_false; + } if (strNE(name,"-")) TAINT_ENV(); TAINT_PROPER("piped open"); @@ -285,6 +292,13 @@ do_open(GV *gv, register char *name, I32 len, int as_raw, int rawmode, int rawpe name[--len] = '\0'; /*SUPPRESS 530*/ for (; isSPACE(*name); name++) ; + if (*name == '\0') { /* command is missing 19990114 */ + dTHR; + if (ckWARN(WARN_PIPE)) + warner(WARN_PIPE, "Missing command in piped open"); + errno = EPIPE; + goto say_false; + } if (strNE(name,"-")) TAINT_ENV(); TAINT_PROPER("piped open"); |