comparison src/quickfix.c @ 10367:4e4e116e3689 v8.0.0078

commit https://github.com/vim/vim/commit/63bed3d319b5d90765dbdae93a3579b6322d79fb Author: Bram Moolenaar <Bram@vim.org> Date: Sat Nov 12 15:36:54 2016 +0100 patch 8.0.0078 Problem: Accessing freed memory in quickfix. Solution: Reset pointer when freeing 'errorformat'. (Domenique Pelle)
author Christian Brabandt <cb@256bit.org>
date Sat, 12 Nov 2016 15:45:04 +0100
parents 66f1b5bf3fa6
children 4e5b307638cb
comparison
equal deleted inserted replaced
10366:cedf99a9a1b1 10367:4e4e116e3689
111 char_u flags; /* additional flags given in prefix */ 111 char_u flags; /* additional flags given in prefix */
112 /* '-' do not include this line */ 112 /* '-' do not include this line */
113 /* '+' include whole line in message */ 113 /* '+' include whole line in message */
114 int conthere; /* %> used */ 114 int conthere; /* %> used */
115 }; 115 };
116
117 static efm_T *fmt_start = NULL; /* cached across qf_parse_line() calls */
116 118
117 static int qf_init_ext(qf_info_T *qi, char_u *efile, buf_T *buf, typval_T *tv, char_u *errorformat, int newlist, linenr_T lnumfirst, linenr_T lnumlast, char_u *qf_title); 119 static int qf_init_ext(qf_info_T *qi, char_u *efile, buf_T *buf, typval_T *tv, char_u *errorformat, int newlist, linenr_T lnumfirst, linenr_T lnumlast, char_u *qf_title);
118 static void qf_store_title(qf_info_T *qi, char_u *title); 120 static void qf_store_title(qf_info_T *qi, char_u *title);
119 static void qf_new_list(qf_info_T *qi, char_u *qf_title); 121 static void qf_new_list(qf_info_T *qi, char_u *qf_title);
120 static void ll_free_all(qf_info_T **pqi); 122 static void ll_free_all(qf_info_T **pqi);
387 { 389 {
388 *efm_first = efm_ptr->next; 390 *efm_first = efm_ptr->next;
389 vim_regfree(efm_ptr->prog); 391 vim_regfree(efm_ptr->prog);
390 vim_free(efm_ptr); 392 vim_free(efm_ptr);
391 } 393 }
394 fmt_start = NULL;
392 } 395 }
393 396
394 /* Parse 'errorformat' option */ 397 /* Parse 'errorformat' option */
395 static efm_T * 398 static efm_T *
396 parse_efm_option(char_u *efm) 399 parse_efm_option(char_u *efm)
784 int linelen, 787 int linelen,
785 efm_T *fmt_first, 788 efm_T *fmt_first,
786 qffields_T *fields) 789 qffields_T *fields)
787 { 790 {
788 efm_T *fmt_ptr; 791 efm_T *fmt_ptr;
789 static efm_T *fmt_start = NULL; /* cached across calls */
790 char_u *ptr; 792 char_u *ptr;
791 int len; 793 int len;
792 int i; 794 int i;
793 int idx = 0; 795 int idx = 0;
794 char_u *tail = NULL; 796 char_u *tail = NULL;