diff options
author | Bram Moolenaar <Bram@vim.org> | 2017-01-10 13:55:14 +0100 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2017-01-10 13:55:14 +0100 |
commit | f446b48ff0bffae2b453cd4f9e3c25dfe363d29d (patch) | |
tree | e747eedc7a254c8335b0f56f443f5688816bcf7b /src/regexp_nfa.c | |
parent | caa55b65c204946d160c1b743c5f8f3b506dc4d3 (diff) | |
download | vim-git-f446b48ff0bffae2b453cd4f9e3c25dfe363d29d.tar.gz |
patch 8.0.0165: ubsan warns for integer overflowv8.0.0165
Problem: Ubsan warns for integer overflow.
Solution: Swap two conditions. (Dominique Pelle)
Diffstat (limited to 'src/regexp_nfa.c')
-rw-r--r-- | src/regexp_nfa.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/regexp_nfa.c b/src/regexp_nfa.c index 919dadcb0..de22dcbac 100644 --- a/src/regexp_nfa.c +++ b/src/regexp_nfa.c @@ -50,7 +50,7 @@ enum NFA_CONCAT, /* concatenate two previous items (postfix * only) */ NFA_OR, /* \| (postfix only) */ - NFA_STAR, /* greedy * (posfix 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,7 +2169,7 @@ nfa_regpiece(void) * 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)) + && (maxval > 500 || maxval > minval + 200)) return FAIL; /* Ignore previous call to nfa_regatom() */ |