To: vim_dev@googlegroups.com Subject: Patch 8.2.0033 Fcc: outbox From: Bram Moolenaar Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ------------ Patch 8.2.0033 Problem: Crash when make_extmatch() runs out of memory. Solution: Check for NULL. (Dominique Pelle, closs #5392) Files: src/regexp_bt.c, src/regexp_nfa.c *** ../vim-8.2.0032/src/regexp_bt.c 2019-09-08 17:19:06.000000000 +0200 --- src/regexp_bt.c 2019-12-22 19:38:10.490383737 +0100 *************** *** 4568,4573 **** --- 4568,4575 ---- cleanup_zsubexpr(); re_extmatch_out = make_extmatch(); + if (re_extmatch_out == NULL) + return 0; for (i = 0; i < NSUBEXP; i++) { if (REG_MULTI) *** ../vim-8.2.0032/src/regexp_nfa.c 2019-12-05 21:01:38.000000000 +0100 --- src/regexp_nfa.c 2019-12-22 19:38:56.306300736 +0100 *************** *** 7070,7075 **** --- 7070,7077 ---- { cleanup_zsubexpr(); re_extmatch_out = make_extmatch(); + if (re_extmatch_out == NULL) + return 0; // Loop over \z1, \z2, etc. There is no \z0. for (i = 1; i < subs.synt.in_use; i++) { *** ../vim-8.2.0032/src/version.c 2019-12-22 18:28:48.252481062 +0100 --- src/version.c 2019-12-22 19:40:01.034174291 +0100 *************** *** 744,745 **** --- 744,747 ---- { /* Add new patch number below this line */ + /**/ + 33, /**/ -- PRINCE: He's come to rescue me, father. LAUNCELOT: (embarrassed) Well, let's not jump to conclusions ... "Monty Python and the Holy Grail" PYTHON (MONTY) PICTURES LTD /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ /// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ \\\ an exciting new programming language -- http://www.Zimbu.org /// \\\ help me help AIDS victims -- http://ICCF-Holland.org ///