File php7-CVE-2024-11233.patch of Package php7.37962

Index: php-7.4.33/ext/standard/filters.c
===================================================================
--- php-7.4.33.orig/ext/standard/filters.c
+++ php-7.4.33/ext/standard/filters.c
@@ -1128,6 +1128,9 @@ static php_conv_err_t php_conv_qprint_de
 			} break;
 
 			case 5: {
+				if (icnt == 0) {
+					goto out;
+				}
 				if (!inst->lbchars && lb_cnt == 1 && *ps == '\n') {
 					/* auto-detect soft line breaks, found network line break */
 					lb_cnt = lb_ptr = 0;
@@ -1141,15 +1144,13 @@ static php_conv_err_t php_conv_qprint_de
 					/* soft line break */
 					lb_cnt = lb_ptr = 0;
 					scan_stat = 0;
-				} else if (icnt > 0) {
+				} else {
 					if (*ps == (unsigned char)inst->lbchars[lb_cnt]) {
 						lb_cnt++;
 						ps++, icnt--;
 					} else {
 						scan_stat = 6; /* no break for short-cut */
 					}
-				} else {
-					goto out;
 				}
 			} break;
 
openSUSE Build Service is sponsored by