aboutsummaryrefslogtreecommitdiff
path: root/bin/sh/expand.c
diff options
context:
space:
mode:
Diffstat (limited to 'bin/sh/expand.c')
-rw-r--r--bin/sh/expand.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/bin/sh/expand.c b/bin/sh/expand.c
index 1d5864d233bf..95d2e504cd70 100644
--- a/bin/sh/expand.c
+++ b/bin/sh/expand.c
@@ -664,8 +664,10 @@ expandmeta(str)
savelastp = exparg.lastp;
INTOFF;
if (expdir == NULL)
- expdir = ckmalloc(1024); /* I hope this is big enough */
+ expdir = ckmalloc(8192); /* I hope this is big enough */
expmeta(expdir, str->text);
+ if(strlen(expdir) >= 8192)
+ error("malloc overflow in sh:expand.c in ckmalloc(8192)\n");
ckfree(expdir);
expdir = NULL;
INTON;