To: vim_dev@googlegroups.com Subject: Patch 8.0.0165 Fcc: outbox From: Bram Moolenaar Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ------------ Patch 8.0.0165 Problem: Ubsan warns for integer overflow. Solution: Swap two conditions. (Dominique Pelle) Files: src/regexp_nfa.c *** ../vim-8.0.0164/src/regexp_nfa.c 2017-01-08 20:50:47.433486722 +0100 --- src/regexp_nfa.c 2017-01-10 13:53:01.154397567 +0100 *************** *** 50,56 **** NFA_CONCAT, /* concatenate two previous items (postfix * only) */ NFA_OR, /* \| (postfix only) */ ! NFA_STAR, /* greedy * (posfix only) */ NFA_STAR_NONGREEDY, /* non-greedy * (postfix only) */ NFA_QUEST, /* greedy \? (postfix only) */ NFA_QUEST_NONGREEDY, /* non-greedy \? (postfix only) */ --- 50,56 ---- NFA_CONCAT, /* concatenate two previous items (postfix * only) */ NFA_OR, /* \| (postfix only) */ ! NFA_STAR, /* greedy * (postfix only) */ NFA_STAR_NONGREEDY, /* non-greedy * (postfix only) */ NFA_QUEST, /* greedy \? (postfix only) */ NFA_QUEST_NONGREEDY, /* non-greedy \? (postfix only) */ *************** *** 2169,2175 **** * maximum is much larger than the minimum and when the maximum is * large. Bail out if we can use the other engine. */ if ((nfa_re_flags & RE_AUTO) ! && (maxval > minval + 200 || maxval > 500)) return FAIL; /* Ignore previous call to nfa_regatom() */ --- 2169,2175 ---- * maximum is much larger than the minimum and when the maximum is * large. Bail out if we can use the other engine. */ if ((nfa_re_flags & RE_AUTO) ! && (maxval > 500 || maxval > minval + 200)) return FAIL; /* Ignore previous call to nfa_regatom() */ *** ../vim-8.0.0164/src/version.c 2017-01-10 13:51:05.587236267 +0100 --- src/version.c 2017-01-10 13:54:22.873804709 +0100 *************** *** 766,767 **** --- 766,769 ---- { /* Add new patch number below this line */ + /**/ + 165, /**/ -- "Marriage is a wonderful institution... but who wants to live in an institution?" - Groucho Marx /// 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 ///