about summary refs log tree commit diff
path: root/Src/Zle/compctl.c
diff options
context:
space:
mode:
authorPeter Stephenson <p.w.stephenson@ntlworld.com>2016-11-17 19:49:17 +0000
committerPeter Stephenson <p.w.stephenson@ntlworld.com>2016-11-17 19:49:17 +0000
commita62e1640bcafbb82d86ea8d8ce057a83c4683d60 (patch)
treeb2e99365eb00070fd5b51f45d9cbb14fb1a17fd4 /Src/Zle/compctl.c
parent297471cf7737c4dfe8097988b8a5bd61872df837 (diff)
downloadzsh-a62e1640bcafbb82d86ea8d8ce057a83c4683d60.tar.gz
zsh-a62e1640bcafbb82d86ea8d8ce057a83c4683d60.tar.xz
zsh-a62e1640bcafbb82d86ea8d8ce057a83c4683d60.zip
39958: Add extra byte to PATH_MAX allocations.
This ensures we've got enough space for a null, although this
isn't always needed.
Diffstat (limited to 'Src/Zle/compctl.c')
-rw-r--r--Src/Zle/compctl.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/Src/Zle/compctl.c b/Src/Zle/compctl.c
index 09e590569..52c6f1233 100644
--- a/Src/Zle/compctl.c
+++ b/Src/Zle/compctl.c
@@ -2135,7 +2135,7 @@ gen_matches_files(int dirs, int execs, int all)
 {
     DIR *d;
     struct stat buf;
-    char *n, p[PATH_MAX], *q = NULL, *e, *pathpref;
+    char *n, p[PATH_MAX+1], *q = NULL, *e, *pathpref;
     LinkList l = NULL;
     int ns = 0, ng = opts[NULLGLOB], test, aw = addwhat, pathpreflen;