commit | 271906bc067a8f25422016665001d2e44cf618e2 | [log] [tgz] |
---|---|---|
author | Bram Moolenaar <Bram@vim.org> | Sat Aug 28 12:30:12 2021 +0200 |
committer | Bram Moolenaar <Bram@vim.org> | Sat Aug 28 12:30:12 2021 +0200 |
tree | 83fee8240a2be83f321c8cee236caa7afbb427fb | |
parent | 6024c0427ce1196344439997d5e41a6f8546368c [diff] [blame] |
patch 8.2.3379: crash when using NULL job Problem: Crash when using NULL job. Solution: Copy static string into buffer. (issue #8260)
diff --git a/src/job.c b/src/job.c index 884bf64..afa9972 100644 --- a/src/job.c +++ b/src/job.c
@@ -1983,7 +1983,10 @@ char *status; if (job == NULL) - return (char_u *)"no process"; + { + vim_snprintf((char *)buf, NUMBUFLEN, "no process"); + return buf; + } status = job->jv_status == JOB_FAILED ? "fail" : job->jv_status >= JOB_ENDED ? "dead" : "run";