Mercurial > vim
comparison src/syntax.c @ 21240:e35955a787a8 v8.2.1171
patch 8.2.1171: possible crash when out of memory
Commit: https://github.com/vim/vim/commit/58bb61cf5ee008254eb331bc3574eac87d2dcc4a
Author: Bram Moolenaar <Bram@vim.org>
Date: Fri Jul 10 20:30:12 2020 +0200
patch 8.2.1171: possible crash when out of memory
Problem: Possible crash when out of memory.
Solution: Check for NULL pointer. (Dominique Pell?, closes https://github.com/vim/vim/issues/6432)
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Fri, 10 Jul 2020 20:45:04 +0200 |
parents | 9064044fd4f6 |
children | a6af570dad75 |
comparison
equal
deleted
inserted
replaced
21239:bc30efb26e7d | 21240:e35955a787a8 |
---|---|
5762 { | 5762 { |
5763 arg_end = skiptowhite(arg_start); | 5763 arg_end = skiptowhite(arg_start); |
5764 next_arg = skipwhite(arg_end); | 5764 next_arg = skipwhite(arg_end); |
5765 vim_free(key); | 5765 vim_free(key); |
5766 key = vim_strnsave_up(arg_start, arg_end - arg_start); | 5766 key = vim_strnsave_up(arg_start, arg_end - arg_start); |
5767 if (key == NULL) | |
5768 break; | |
5767 if (STRCMP(key, "CCOMMENT") == 0) | 5769 if (STRCMP(key, "CCOMMENT") == 0) |
5768 { | 5770 { |
5769 if (!eap->skip) | 5771 if (!eap->skip) |
5770 curwin->w_s->b_syn_sync_flags |= SF_CCOMMENT; | 5772 curwin->w_s->b_syn_sync_flags |= SF_CCOMMENT; |
5771 if (!ends_excmd2(eap->cmd, next_arg)) | 5773 if (!ends_excmd2(eap->cmd, next_arg)) |