aboutsummaryrefslogtreecommitdiff
path: root/cmdedit.c
diff options
context:
space:
mode:
authorEric Andersen <andersen@codepoet.org>2001-05-11 16:58:46 +0000
committerEric Andersen <andersen@codepoet.org>2001-05-11 16:58:46 +0000
commit5f265b755a92e7efdbd0d18694913209dfd9e055 (patch)
treee6644e9f97dab0198ad771e1d330e02a7cce8553 /cmdedit.c
parent9d94deabd398634c6d1c601ba276f5afd97b2050 (diff)
downloadbusybox-5f265b755a92e7efdbd0d18694913209dfd9e055.tar.gz
Fix a segfault in lash, hush, and cmdedit. Each of these used
xgetcwd, but did not check the return for a NULL, and then continued to call strlen on the NULL when the cwd had been removed from under it. -Erik
Diffstat (limited to 'cmdedit.c')
-rw-r--r--cmdedit.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/cmdedit.c b/cmdedit.c
index ce5450032..ec9939312 100644
--- a/cmdedit.c
+++ b/cmdedit.c
@@ -355,6 +355,10 @@ static void parse_prompt(const char *prmt_ptr)
char c;
char *pbuf;
+ if (!pwd_buf) {
+ pwd_buf=unknown;
+ }
+
while (*prmt_ptr) {
pbuf = buf;
pbuf[1] = 0;