diff options
author | Bram Moolenaar <Bram@vim.org> | 2011-04-28 17:24:58 +0200 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2011-04-28 17:24:58 +0200 |
commit | f8441477474f5ca2aa33660e0472a668f8c8bf0a (patch) | |
tree | d4142e0b9c039c7034cc54029db291b5015d1ca6 /src/option.c | |
parent | cca92ec8cfb16cf8341a928c9bea8ea56aa8df40 (diff) | |
download | vim-git-f8441477474f5ca2aa33660e0472a668f8c8bf0a.tar.gz |
updated for version 7.3.166v7.3.166
Problem: Buffer on the stack may be too big
Solution: Allocate the space.
Diffstat (limited to 'src/option.c')
-rw-r--r-- | src/option.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/src/option.c b/src/option.c index 6e9b3db1a..a545588f4 100644 --- a/src/option.c +++ b/src/option.c @@ -9185,7 +9185,7 @@ put_setstring(fd, cmd, name, valuep, expand) int expand; { char_u *s; - char_u buf[MAXPATHL]; + char_u *buf; if (fprintf(fd, "%s %s=", cmd, name) < 0) return FAIL; @@ -9203,9 +9203,16 @@ put_setstring(fd, cmd, name, valuep, expand) } else if (expand) { + buf = alloc(MAXPATHL); + if (buf == NULL) + return FAIL; home_replace(NULL, *valuep, buf, MAXPATHL, FALSE); if (put_escstr(fd, buf, 2) == FAIL) + { + vim_free(buf); return FAIL; + } + vim_free(buf); } else if (put_escstr(fd, *valuep, 2) == FAIL) return FAIL; |