iliaa           Mon Sep 12 12:59:57 2005 EDT

  Modified files:              (Branch: PHP_4_4)
    /php-src    NEWS 
    /php-src/ext/pspell pspell.c 
  Log:
  MFH: Fixed bug #34456 (Possible crash inside pspell extension).
  
  
http://cvs.php.net/diff.php/php-src/NEWS?r1=1.1247.2.920.2.37&r2=1.1247.2.920.2.38&ty=u
Index: php-src/NEWS
diff -u php-src/NEWS:1.1247.2.920.2.37 php-src/NEWS:1.1247.2.920.2.38
--- php-src/NEWS:1.1247.2.920.2.37      Mon Sep  5 12:25:42 2005
+++ php-src/NEWS        Mon Sep 12 12:59:51 2005
@@ -2,6 +2,7 @@
 |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
 ?? ??? 2005, Version 4.4.1
 - Added "new_link" parameter to mssql_connect(). Bug #34369. (Frank)
+- Fixed bug #34456 (Possible crash inside pspell extension). (Nuno)
 - Fixed bug #34311 (unserialize() crashes with chars above 191 dec). (Nuno)
 - Fixed bug #34307 (on_modify handler not called to set the default value if
   setting from php.ini was invalid). (Andrei)
http://cvs.php.net/diff.php/php-src/ext/pspell/pspell.c?r1=1.28.8.5&r2=1.28.8.5.4.1&ty=u
Index: php-src/ext/pspell/pspell.c
diff -u php-src/ext/pspell/pspell.c:1.28.8.5 
php-src/ext/pspell/pspell.c:1.28.8.5.4.1
--- php-src/ext/pspell/pspell.c:1.28.8.5        Thu Aug 28 16:01:29 2003
+++ php-src/ext/pspell/pspell.c Mon Sep 12 12:59:56 2005
@@ -16,7 +16,7 @@
    +----------------------------------------------------------------------+
 */
 
-/* $Id: pspell.c,v 1.28.8.5 2003/08/28 20:01:29 iliaa Exp $ */
+/* $Id: pspell.c,v 1.28.8.5.4.1 2005/09/12 16:59:56 iliaa Exp $ */
 
 #define IS_EXT_MODULE
 
@@ -669,6 +669,7 @@
        zval **sccin, **runtogether;
        int argc;
 
+       PspellManager *manager;
        PspellConfig *config;
        
        argc = ZEND_NUM_ARGS();
@@ -677,12 +678,13 @@
        }
 
        convert_to_long_ex(sccin);
-       config = (PspellConfig *) zend_list_find(Z_LVAL_PP(sccin), &type);
-       if(!config){
+       manager = (PspellManager *) zend_list_find(Z_LVAL_PP(sccin), &type);
+       if (!manager){
                php_error(E_WARNING, "%ld is not a PSPELL config 
index",Z_LVAL_PP(sccin));
                RETURN_FALSE;
        }
 
+       config = pspell_manager_config(manager);
        convert_to_boolean_ex(runtogether);
        pspell_config_replace(config, "run-together", Z_LVAL_PP(runtogether) ? 
"true" : "false");
        
@@ -698,6 +700,7 @@
        zval **sccin, **mode;
        int argc;
 
+       PspellManager *manager;
        PspellConfig *config;
        
        argc = ZEND_NUM_ARGS();
@@ -706,12 +709,13 @@
        }
 
        convert_to_long_ex(sccin);
-       config = (PspellConfig *) zend_list_find(Z_LVAL_PP(sccin), &type);
-       if(!config){
+       manager = (PspellManager *) zend_list_find(Z_LVAL_PP(sccin), &type);
+       if (!manager) {
                php_error(E_WARNING, "%ld is not a PSPELL config 
index",Z_LVAL_PP(sccin));
                RETURN_FALSE;
        }
 
+       config = pspell_manager_config(manager);
        convert_to_long_ex(mode);
 
        /* First check what mode we want (how many suggestions) */
@@ -739,6 +743,7 @@
        char ignore_str[PSPELL_LARGEST_WORD + 1];       
        long ignore = 0L;
 
+       PspellManager *manager;
        PspellConfig *config;
        
        argc = ZEND_NUM_ARGS();
@@ -747,11 +752,12 @@
        }
 
        convert_to_long_ex(sccin);
-       config = (PspellConfig *) zend_list_find(Z_LVAL_PP(sccin), &type);
-       if(!config){
+       manager = (PspellManager *) zend_list_find(Z_LVAL_PP(sccin), &type);
+       if (!manager) {
                php_error(E_WARNING, "%ld is not a PSPELL config 
index",Z_LVAL_PP(sccin));
                RETURN_FALSE;
        }
+       config = pspell_manager_config(manager);
 
        convert_to_long_ex(pignore);
        ignore = Z_LVAL_PP(pignore);
@@ -786,6 +792,7 @@
        int argc;
 
        PspellConfig *config;
+       PspellManager *manager;
        
        argc = ZEND_NUM_ARGS();
        if (argc != 2 || zend_get_parameters_ex(argc,&sccin,&personal) == 
FAILURE) {
@@ -793,12 +800,13 @@
        }
 
        convert_to_long_ex(sccin);
-       config = (PspellConfig *) zend_list_find(Z_LVAL_PP(sccin), &type);
-       if(!config){
+       manager = (PspellManager *) zend_list_find(Z_LVAL_PP(sccin), &type);
+       if (!manager) {
                php_error(E_WARNING, "%ld is not a PSPELL config 
index",Z_LVAL_PP(sccin));
                RETURN_FALSE;
        }
 
+       config = pspell_manager_config(manager);
        convert_to_string_ex(personal);
 
        if (PG(safe_mode) && (!php_checkuid(Z_STRVAL_PP(personal), NULL, 
CHECKUID_CHECK_FILE_AND_DIR))) {
@@ -823,6 +831,7 @@
        zval **sccin, **repl;
        int argc;
 
+       PspellManager *manager;
        PspellConfig *config;
        
        argc = ZEND_NUM_ARGS();
@@ -831,12 +840,13 @@
        }
 
        convert_to_long_ex(sccin);
-       config = (PspellConfig *) zend_list_find(Z_LVAL_PP(sccin), &type);
-       if(!config){
+       manager = (PspellManager *) zend_list_find(Z_LVAL_PP(sccin), &type);
+       if (!manager) {
                php_error(E_WARNING, "%ld is not a PSPELL config 
index",Z_LVAL_PP(sccin));
                RETURN_FALSE;
        }
 
+       config = pspell_manager_config(manager);
        pspell_config_replace(config, "save-repl", "true");
 
        convert_to_string_ex(repl);
@@ -863,6 +873,7 @@
        zval **sccin, **save;
        int argc;
 
+       PspellManager *manager;
        PspellConfig *config;
        
        argc = ZEND_NUM_ARGS();
@@ -871,12 +882,13 @@
        }
 
        convert_to_long_ex(sccin);
-       config = (PspellConfig *) zend_list_find(Z_LVAL_PP(sccin), &type);
-       if(!config){
+       manager = (PspellManager *) zend_list_find(Z_LVAL_PP(sccin), &type);
+       if (!manager) {
                php_error(E_WARNING, "%ld is not a PSPELL config 
index",Z_LVAL_PP(sccin));
                RETURN_FALSE;
        }
 
+       config = pspell_manager_config(manager);
        convert_to_boolean_ex(save);
        pspell_config_replace(config, "save-repl", Z_LVAL_PP(save) ? "true" : 
"false");
 

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to