Fixed bug #62838
authorAntony Dovgal <tony2001@php.net>
Thu, 16 Aug 2012 10:32:55 +0000 (14:32 +0400)
committerAntony Dovgal <tony2001@php.net>
Thu, 16 Aug 2012 10:32:55 +0000 (14:32 +0400)
enchant_dict_quick_check() destroys zval, but fails to initialize it

NEWS
ext/enchant/enchant.c

diff --git a/NEWS b/NEWS
index c7afe53d94e0ac8938d9c0da3d7003efd2a6974e..8da7256017347625c514cd81828a3e55760cd7b1 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -33,6 +33,10 @@ PHP                                                                        NEWS
   . Fixed bug #62616 (ArrayIterator::count() from IteratorIterator instance
     gives Segmentation fault). (Laruence, Gustavo)
 
+- Enchant:
+  . Fixed bug #62838 (enchant_dict_quick_check() destroys zval, but fails to 
+  initialize it). (Tony, Mateusz Goik).
+
 19 Jul 2012, PHP 5.3.15
 
 - Zend Engine:
index 0126d9ef4ed28f85fbab1ddb4e10ba927289f0cd..dcc39e267b2fa8b8f62aa6c5af4b4c6494c19468 100755 (executable)
@@ -729,6 +729,7 @@ PHP_FUNCTION(enchant_dict_quick_check)
 
        if (sugg) {
                zval_dtor(sugg);
+               array_init(sugg);
        }
 
        PHP_ENCHANT_GET_DICT;
@@ -742,8 +743,6 @@ PHP_FUNCTION(enchant_dict_quick_check)
                        RETURN_FALSE;
                }
 
-               array_init(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) {