cvs: php4 /ext/pspell pspell.c

From: Date: Wed, 21 May 2003 23:04:18 +0000
Subject: cvs: php4 /ext/pspell pspell.c
Groups: php.cvs 
Request: Send a blank email to php-cvs+get-21200@lists.php.net to get a copy of this message
jay Wed May 21 19:04:18 2003 EDT Modified files: /php4/ext/pspell pspell.c Log: Fix segfault in pspell_new_config(). Also fix grammar in error messages. Index: php4/ext/pspell/pspell.c diff -u php4/ext/pspell/pspell.c:1.31 php4/ext/pspell/pspell.c:1.32 --- php4/ext/pspell/pspell.c:1.31 Sat Jan 18 19:45:47 2003 +++ php4/ext/pspell/pspell.c Wed May 21 19:04:18 2003 @@ -16,7 +16,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: pspell.c,v 1.31 2003/01/19 00:45:47 iliaa Exp $ */ +/* $Id: pspell.c,v 1.32 2003/05/21 23:04:18 jay Exp $ */ #define IS_EXT_MODULE @@ -288,6 +288,12 @@ convert_to_long_ex(conf); config = (PspellConfig *) zend_list_find(Z_LVAL_PP(conf), &type); + + if (config == NULL || type != le_pspell_config) { + php_error_docref(NULL TSRMLS_CC, E_WARNING, "%d is not a PSPELL config index", Z_LVAL_PP(conf)); + RETURN_FALSE; + } + ret = new_pspell_manager(config); if(pspell_error_number(ret) != 0){ @@ -319,7 +325,7 @@ convert_to_string_ex(word); manager = (PspellManager *) zend_list_find(Z_LVAL_PP(scin), &type); if(!manager){ - php_error_docref(NULL TSRMLS_CC, E_WARNING, "%d is not an PSPELL result index",Z_LVAL_PP(scin)); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "%d is not a PSPELL result index",Z_LVAL_PP(scin)); RETURN_FALSE; } @@ -351,7 +357,7 @@ convert_to_string_ex(word); manager = (PspellManager *) zend_list_find(Z_LVAL_PP(scin), &type); if(!manager){ - php_error_docref(NULL TSRMLS_CC, E_WARNING, "%d is not an PSPELL result index",Z_LVAL_PP(scin)); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "%d is not a PSPELL result index",Z_LVAL_PP(scin)); RETURN_FALSE; } @@ -390,7 +396,7 @@ convert_to_string_ex(corr); manager = (PspellManager *) zend_list_find(Z_LVAL_PP(scin), &type); if(!manager){ - php_error_docref(NULL TSRMLS_CC, E_WARNING, "%d is not an PSPELL result index",Z_LVAL_PP(scin)); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "%d is not a PSPELL result index",Z_LVAL_PP(scin)); RETURN_FALSE; } @@ -422,7 +428,7 @@ convert_to_string_ex(word); manager = (PspellManager *) zend_list_find(Z_LVAL_PP(scin), &type); if(!manager){ - php_error_docref(NULL TSRMLS_CC, E_WARNING, "%d is not an PSPELL result index",Z_LVAL_PP(scin)); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "%d is not a PSPELL result index",Z_LVAL_PP(scin)); RETURN_FALSE; } @@ -459,7 +465,7 @@ convert_to_string_ex(word); manager = (PspellManager *) zend_list_find(Z_LVAL_PP(scin), &type); if(!manager){ - php_error_docref(NULL TSRMLS_CC, E_WARNING, "%d is not an PSPELL result index",Z_LVAL_PP(scin)); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "%d is not a PSPELL result index",Z_LVAL_PP(scin)); RETURN_FALSE; } @@ -495,7 +501,7 @@ convert_to_long_ex(scin); manager = (PspellManager *) zend_list_find(Z_LVAL_PP(scin), &type); if(!manager){ - php_error_docref(NULL TSRMLS_CC, E_WARNING, "%d is not an PSPELL result index",Z_LVAL_PP(scin)); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "%d is not a PSPELL result index",Z_LVAL_PP(scin)); RETURN_FALSE; } @@ -526,7 +532,7 @@ convert_to_long_ex(scin); manager = (PspellManager *) zend_list_find(Z_LVAL_PP(scin), &type); if(!manager){ - php_error_docref(NULL TSRMLS_CC, E_WARNING, "%d is not an PSPELL result index",Z_LVAL_PP(scin)); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "%d is not a PSPELL result index",Z_LVAL_PP(scin)); RETURN_FALSE; } @@ -609,7 +615,7 @@ convert_to_long_ex(sccin); config = (PspellConfig *) zend_list_find(Z_LVAL_PP(sccin), &type); if(!config){ - php_error_docref(NULL TSRMLS_CC, E_WARNING, "%d is not an PSPELL config index",Z_LVAL_PP(sccin)); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "%d is not a PSPELL config index",Z_LVAL_PP(sccin)); RETURN_FALSE; } @@ -638,7 +644,7 @@ convert_to_long_ex(sccin); config = (PspellConfig *) zend_list_find(Z_LVAL_PP(sccin), &type); if(!config){ - php_error_docref(NULL TSRMLS_CC, E_WARNING, "%d is not an PSPELL config index",Z_LVAL_PP(sccin)); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "%d is not a PSPELL config index",Z_LVAL_PP(sccin)); RETURN_FALSE; } @@ -680,7 +686,7 @@ convert_to_long_ex(sccin); config = (PspellConfig *) zend_list_find(Z_LVAL_PP(sccin), &type); if(!config){ - php_error_docref(NULL TSRMLS_CC, E_WARNING, "%d is not an PSPELL config index",Z_LVAL_PP(sccin)); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "%d is not a PSPELL config index",Z_LVAL_PP(sccin)); RETURN_FALSE; } @@ -726,7 +732,7 @@ convert_to_long_ex(sccin); config = (PspellConfig *) zend_list_find(Z_LVAL_PP(sccin), &type); if(!config){ - php_error_docref(NULL TSRMLS_CC, E_WARNING, "%d is not an PSPELL config index",Z_LVAL_PP(sccin)); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "%d is not a PSPELL config index",Z_LVAL_PP(sccin)); RETURN_FALSE; } @@ -755,7 +761,7 @@ convert_to_long_ex(sccin); config = (PspellConfig *) zend_list_find(Z_LVAL_PP(sccin), &type); if(!config){ - php_error_docref(NULL TSRMLS_CC, E_WARNING, "%d is not an PSPELL config index",Z_LVAL_PP(sccin)); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "%d is not a PSPELL config index",Z_LVAL_PP(sccin)); RETURN_FALSE; } @@ -786,7 +792,7 @@ convert_to_long_ex(sccin); config = (PspellConfig *) zend_list_find(Z_LVAL_PP(sccin), &type); if(!config){ - php_error_docref(NULL TSRMLS_CC, E_WARNING, "%d is not an PSPELL config index",Z_LVAL_PP(sccin)); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "%d is not a PSPELL config index",Z_LVAL_PP(sccin)); RETURN_FALSE; }

« previous php.cvs (#21200) next »