# HG changeset patch # User Christian Brabandt # Date 1494831605 -7200 # Node ID 3270f080bf0a4bfb8cb40b37ac74ec33c1ff689d # Parent 98d6836199efecc1c66f5134e4bc5195b7210914 patch 8.0.0597: off-by-one error in size computation commit https://github.com/vim/vim/commit/253f9128779f315ea670f9b4a17446b7b4c74927 Author: Bram Moolenaar Date: Mon May 15 08:45:13 2017 +0200 patch 8.0.0597: off-by-one error in size computation Problem: Off-by-one error in buffer size computation. Solution: Use ">=" instead of ">". (Lemonboy, closes https://github.com/vim/vim/issues/1694) diff --git a/src/quickfix.c b/src/quickfix.c --- a/src/quickfix.c +++ b/src/quickfix.c @@ -919,7 +919,7 @@ restofline: } if (fmt_ptr->flags == '+' && !qi->qf_multiscan) /* %+ */ { - if (linelen > fields->errmsglen) + if (linelen >= fields->errmsglen) { /* linelen + null terminator */ if ((fields->errmsg = vim_realloc(fields->errmsg, @@ -934,7 +934,7 @@ restofline: if (regmatch.startp[i] == NULL || regmatch.endp[i] == NULL) continue; len = (int)(regmatch.endp[i] - regmatch.startp[i]); - if (len > fields->errmsglen) + if (len >= fields->errmsglen) { /* len + null terminator */ if ((fields->errmsg = vim_realloc(fields->errmsg, len + 1)) @@ -1017,7 +1017,7 @@ restofline: fields->namebuf[0] = NUL; /* no match found, remove file name */ fields->lnum = 0; /* don't jump to this line */ fields->valid = FALSE; - if (linelen > fields->errmsglen) + if (linelen >= fields->errmsglen) { /* linelen + null terminator */ if ((fields->errmsg = vim_realloc(fields->errmsg, diff --git a/src/version.c b/src/version.c --- a/src/version.c +++ b/src/version.c @@ -765,6 +765,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ /**/ + 597, +/**/ 596, /**/ 595,