]> granicus.if.org Git - php/commitdiff
Revert "Fix out-of-bounds write"
authorChristoph M. Becker <cmbecker69@gmx.de>
Tue, 20 Oct 2020 15:09:20 +0000 (17:09 +0200)
committerChristoph M. Becker <cmbecker69@gmx.de>
Mon, 26 Oct 2020 14:40:12 +0000 (15:40 +0100)
This reverts commit bf6873a18e3b6b00f82a645c0893a281ae8eadb8.

CVE-2020-26159 is bogus; the "bug" was apparently a false positive
reported by Coverity, and the "fix" apparently wrong, see
<https://github.com/kkos/oniguruma/issues/221>.

Closes GH-6357.

ext/mbstring/oniguruma/src/regcomp.c

index 4f68af234529d9bbb6dc91175317e2388bbb9adb..69d4b95f9521466564c818d8a72dabacb67bc0b4 100644 (file)
@@ -5603,7 +5603,7 @@ concat_opt_exact_str(OptStr* to, UChar* s, UChar* end, OnigEncoding enc)
 
   for (i = to->len, p = s; p < end && i < OPT_EXACT_MAXLEN; ) {
     len = enclen(enc, p);
-    if (i + len >= OPT_EXACT_MAXLEN) break;
+    if (i + len > OPT_EXACT_MAXLEN) break;
     for (j = 0; j < len && p < end; j++)
       to->s[i++] = *p++;
   }