diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/nvim/eval.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/nvim/eval.c b/src/nvim/eval.c index bfe39ced0c..235f7526c2 100644 --- a/src/nvim/eval.c +++ b/src/nvim/eval.c @@ -14480,6 +14480,9 @@ static void get_system_output_as_rettv(typval_T *argvars, typval_T *rettv, free(res); } else { + // res may contain several NULs before the final terminating one. + // Replace them with SOH (1) like in get_cmd_output() to avoid truncation. + memchrsub(res, NUL, 1, nread); #ifdef USE_CRNL // translate <CR><NL> into <NL> char *d = res; |