summaryrefslogtreecommitdiff
path: root/lib/at-func2.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/at-func2.c')
-rw-r--r--lib/at-func2.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/lib/at-func2.c b/lib/at-func2.c
index eaa256cb1e..bb8792f6e1 100644
--- a/lib/at-func2.c
+++ b/lib/at-func2.c
@@ -176,6 +176,13 @@ at_func2 (int fd1, char const *file1,
return func (file1, file2); /* Reduced to case 5. */
}
+ /* Catch invalid arguments before changing directories. */
+ if (file1[0] == '\0' || file2[0] == '\0')
+ {
+ errno = ENOENT;
+ return -1;
+ }
+
/* Cases 3, 7, 12, 13, 15a, 15b remain. With all reductions in
place, it is time to start changing directories. */