diff options
author | Bram Moolenaar <Bram@vim.org> | 2020-07-10 20:30:12 +0200 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2020-07-10 20:30:12 +0200 |
commit | 58bb61cf5ee008254eb331bc3574eac87d2dcc4a (patch) | |
tree | c6e422faf6217c88152632d6849922da8c96054f /src/syntax.c | |
parent | ef85a9b2d9e992ab594e089af3883e381cfad426 (diff) |
patch 8.2.1171: possible crash when out of memoryv8.2.1171
Problem: Possible crash when out of memory.
Solution: Check for NULL pointer. (Dominique Pellé, closes #6432)
Diffstat (limited to 'src/syntax.c')
-rw-r--r-- | src/syntax.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/syntax.c b/src/syntax.c index 6bbe4baccf..ccdb2030cc 100644 --- a/src/syntax.c +++ b/src/syntax.c @@ -5764,6 +5764,8 @@ syn_cmd_sync(exarg_T *eap, int syncing UNUSED) next_arg = skipwhite(arg_end); vim_free(key); key = vim_strnsave_up(arg_start, arg_end - arg_start); + if (key == NULL) + break; if (STRCMP(key, "CCOMMENT") == 0) { if (!eap->skip) |