Sophie

Sophie

distrib > Scientific%20Linux > 5x > x86_64 > by-pkgid > 56662f8135650f8f8f84b2c96c004eb0 > files > 18

php53-5.3.3-24.el5.src.rpm

--- php-5.3.3/ext/mbstring/libmbfl/mbfl/mbfilter.c.cve4156
+++ php-5.3.3/ext/mbstring/libmbfl/mbfl/mbfilter.c
@@ -1397,6 +1397,10 @@ mbfl_strcut(
 			start = string->val + from;
 			end   = start + (length & -4);
 		} else if ((encoding->flag & MBFL_ENCTYPE_SBCS)) {
+			if (from + length >= string->len) {
+				length = string->len - from;
+			}
+
 			start = string->val + from;
 			end = start + length;
 		} else if (encoding->mblen_table != NULL) {