[Pkg-php-commits] [php/debian-sid] Fix an unaligned memory access in enchant_dict_suggest()

Raphael Geissert geissert at debian.org
Sat Mar 13 06:44:11 UTC 2010


---
 .../patches/enchant_unaligned_memory_access.patch  |   27 ++++++++++++++++++++
 debian/patches/series                              |    1 +
 2 files changed, 28 insertions(+), 0 deletions(-)
 create mode 100644 debian/patches/enchant_unaligned_memory_access.patch

diff --git a/debian/patches/enchant_unaligned_memory_access.patch b/debian/patches/enchant_unaligned_memory_access.patch
new file mode 100644
index 0000000..5769bcf
--- /dev/null
+++ b/debian/patches/enchant_unaligned_memory_access.patch
@@ -0,0 +1,27 @@
+Description: Fix an unaligned memory access in enchant_dict_suggest()
+Origin: vendor
+Forwarded: no
+Last-Update: 2010-03-12
+
+Index: php/ext/enchant/enchant.c
+===================================================================
+--- php.orig/ext/enchant/enchant.c
++++ php/ext/enchant/enchant.c
+@@ -777,6 +777,7 @@ PHP_FUNCTION(enchant_dict_suggest)
+ 	char **suggs;
+ 	enchant_dict *pdict;
+ 	int n_sugg;
++	size_t n_sugg_st;
+ 
+ 	if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rs", &dict, &word, &wordlen) == FAILURE) {
+ 		RETURN_FALSE;
+@@ -784,7 +785,8 @@ PHP_FUNCTION(enchant_dict_suggest)
+ 
+ 	PHP_ENCHANT_GET_DICT;
+ 
+-	suggs = enchant_dict_suggest(pdict->pdict, word, wordlen, (size_t *)&n_sugg);
++	suggs = enchant_dict_suggest(pdict->pdict, word, wordlen, &n_sugg_st);
++	memcpy(&n_sugg, &n_sugg_st, sizeof(n_sugg));
+ 	if (suggs && n_sugg) {
+ 		int i;
+ 
diff --git a/debian/patches/series b/debian/patches/series
index f664d7a..5cb33ac 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -51,3 +51,4 @@ php_crypt_revamped.patch
 fix_broken_locale_tests.patch
 fix_broken_gd_bundled-specific_tests.patch
 CVE-2010-0397.patch
+enchant_unaligned_memory_access.patch
-- 
1.6.3.3





More information about the Pkg-php-commits mailing list