Blame SOURCES/php-5.5.6-CVE-2014-0237.patch

e9ca13
From 68ce2d0ea6da79b12a365e375e1c2ce882c77480 Mon Sep 17 00:00:00 2001
e9ca13
From: Stanislav Malyshev <stas@php.net>
e9ca13
Date: Mon, 26 May 2014 17:50:14 -0700
e9ca13
Subject: [PATCH] Fix bug #67328 (fileinfo: numerous file_printf calls
e9ca13
 resulting in performance degradation)
e9ca13
e9ca13
Upstream patch: https://github.com/file/file/commit/b8acc83781d5a24cc5101e525d15efe0482c280d
e9ca13
---
e9ca13
 ext/fileinfo/libmagic/cdf.c | 16 ++++------------
e9ca13
 1 file changed, 4 insertions(+), 12 deletions(-)
e9ca13
e9ca13
diff --git a/ext/fileinfo/libmagic/cdf.c b/ext/fileinfo/libmagic/cdf.c
e9ca13
index dd7177e..8dacd2f 100644
e9ca13
--- a/ext/fileinfo/libmagic/cdf.c
e9ca13
+++ b/ext/fileinfo/libmagic/cdf.c
e9ca13
@@ -942,7 +942,7 @@ int
e9ca13
 cdf_unpack_summary_info(const cdf_stream_t *sst, const cdf_header_t *h,
e9ca13
     cdf_summary_info_header_t *ssi, cdf_property_info_t **info, size_t *count)
e9ca13
 {
e9ca13
-	size_t i, maxcount;
e9ca13
+	size_t maxcount;
e9ca13
 	const cdf_summary_info_header_t *si =
e9ca13
 	    CAST(const cdf_summary_info_header_t *, sst->sst_tab);
e9ca13
 	const cdf_section_declaration_t *sd =
e9ca13
@@ -957,21 +957,13 @@ cdf_unpack_summary_info(const cdf_stream_t *sst, const cdf_header_t *h,
e9ca13
 	ssi->si_os = CDF_TOLE2(si->si_os);
e9ca13
 	ssi->si_class = si->si_class;
e9ca13
 	cdf_swap_class(&ssi->si_class);
e9ca13
-	ssi->si_count = CDF_TOLE2(si->si_count);
e9ca13
+	ssi->si_count = CDF_TOLE4(si->si_count);
e9ca13
 	*count = 0;
e9ca13
 	maxcount = 0;
e9ca13
 	*info = NULL;
e9ca13
-	for (i = 0; i < CDF_TOLE4(si->si_count); i++) {
e9ca13
-		if (i >= CDF_LOOP_LIMIT) {
e9ca13
-			DPRINTF(("Unpack summary info loop limit"));
e9ca13
-			errno = EFTYPE;
e9ca13
-			return -1;
e9ca13
-		}
e9ca13
-		if (cdf_read_property_info(sst, h, CDF_TOLE4(sd->sd_offset),
e9ca13
-		    info, count, &maxcount) == -1) {
e9ca13
+	if (cdf_read_property_info(sst, h, CDF_TOLE4(sd->sd_offset), info,
e9ca13
+		count, &maxcount) == -1) 
e9ca13
 			return -1;
e9ca13
-		}
e9ca13
-	}
e9ca13
 	return 0;
e9ca13
 }
e9ca13
 
e9ca13
-- 
e9ca13
1.9.2
e9ca13