aboutsummaryrefslogtreecommitdiff
path: root/shell/cmdedit.c
diff options
context:
space:
mode:
authorandersen <andersen@69ca8d6d-28ef-0310-b511-8ec308f3f277>2001-05-11 16:58:46 +0000
committerandersen <andersen@69ca8d6d-28ef-0310-b511-8ec308f3f277>2001-05-11 16:58:46 +0000
commit8ff167e7105b330d069ffff351be3eae1df337e8 (patch)
treee6644e9f97dab0198ad771e1d330e02a7cce8553 /shell/cmdedit.c
parentcbdc734b320c0cde4ca3b25d15add9c6153eb7df (diff)
downloadbusybox-w32-8ff167e7105b330d069ffff351be3eae1df337e8.tar.gz
busybox-w32-8ff167e7105b330d069ffff351be3eae1df337e8.tar.bz2
busybox-w32-8ff167e7105b330d069ffff351be3eae1df337e8.zip
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 git-svn-id: svn://busybox.net/trunk/busybox@2613 69ca8d6d-28ef-0310-b511-8ec308f3f277
Diffstat (limited to 'shell/cmdedit.c')
-rw-r--r--shell/cmdedit.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/shell/cmdedit.c b/shell/cmdedit.c
index ce5450032..ec9939312 100644
--- a/shell/cmdedit.c
+++ b/shell/cmdedit.c
@@ -355,6 +355,10 @@ static void parse_prompt(const char *prmt_ptr)
355 char c; 355 char c;
356 char *pbuf; 356 char *pbuf;
357 357
358 if (!pwd_buf) {
359 pwd_buf=unknown;
360 }
361
358 while (*prmt_ptr) { 362 while (*prmt_ptr) {
359 pbuf = buf; 363 pbuf = buf;
360 pbuf[1] = 0; 364 pbuf[1] = 0;