[Pkg-php-commits] [php/debian-sid] Cherry pick fix for crash if aa steps are invalid in GD extension

Ondřej Surý ondrej at sury.org
Wed Jan 5 10:06:14 UTC 2011


---
 .../fix-crash-if-aa-steps-are-invalid.patch        |   14 ++++++++++++++
 debian/patches/series                              |    1 +
 2 files changed, 15 insertions(+), 0 deletions(-)
 create mode 100644 debian/patches/fix-crash-if-aa-steps-are-invalid.patch

diff --git a/debian/patches/fix-crash-if-aa-steps-are-invalid.patch b/debian/patches/fix-crash-if-aa-steps-are-invalid.patch
new file mode 100644
index 0000000..a347afd
--- /dev/null
+++ b/debian/patches/fix-crash-if-aa-steps-are-invalid.patch
@@ -0,0 +1,14 @@
+--- a/ext/gd/gd.c
++++ b/ext/gd/gd.c
+@@ -4228,6 +4228,11 @@ PHP_FUNCTION(imagepstext)
+ 		return;
+ 	}
+ 
++	if (aa_steps != 4 && aa_steps != 16) {
++		php_error_docref(NULL TSRMLS_CC, E_WARNING, "Antialias steps must be 4 or 16");
++		RETURN_FALSE;
++	}
++
+ 	ZEND_FETCH_RESOURCE(bg_img, gdImagePtr, &img, -1, "Image", le_gd);
+ 	ZEND_FETCH_RESOURCE(f_ind, int *, &fnt, -1, "Type 1 font", le_ps_font);
+ 
diff --git a/debian/patches/series b/debian/patches/series
index 97ee0c7..3778317 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -77,3 +77,4 @@ unaligned_memory_access_in_hash_tiger.c.patch
 CVE-2010-4150.patch
 fix-infinite-loop-with-x87-cpu.patch
 do-not-overwrite-GLOBALS-and-this.patch
+fix-crash-if-aa-steps-are-invalid.patch
-- 
1.7.1





More information about the Pkg-php-commits mailing list