]> granicus.if.org Git - php/commitdiff
Fix #68690: Hypothetical off-by-one condition
authorChristoph M. Becker <cmbecker69@gmx.de>
Fri, 3 Apr 2020 12:11:04 +0000 (14:11 +0200)
committerChristoph M. Becker <cmbecker69@gmx.de>
Fri, 3 Apr 2020 12:20:37 +0000 (14:20 +0200)
We fix this, even though `filter->cache == jisx0213_u2_tbl_len` can
never be true here.

ext/mbstring/libmbfl/filters/mbfilter_sjis_2004.c

index 481ae557cc0041264eeda0256c1b050a91fc4c2b..8079c926e36fdd3e2b0f8bfa510674b5996651c4 100644 (file)
@@ -508,7 +508,7 @@ retry:
 
        /* check for 2nd char of combining characters */
        if ((filter->status & 0xf) == 1 &&
-               filter->cache >= 0 && filter->cache <= jisx0213_u2_tbl_len) {
+               filter->cache >= 0 && filter->cache < jisx0213_u2_tbl_len) {
                k = filter->cache;
                filter->status &= ~0xf;
                filter->cache = 0;