Skip to content

Commit

Permalink
fixed #5941 (Segfault on INI handlers in ZTS mode)
Browse files Browse the repository at this point in the history
git-svn-id: http://svn.php.net/repository/pecl/expect/trunk@200384 c90b9560-bf6c-de11-be94-00142212c4b1
  • Loading branch information
Michael Spector committed Nov 12, 2005
1 parent e6a7bb9 commit 743dadd
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions expect.c
Expand Up @@ -49,15 +49,13 @@ zend_module_entry expect_module_entry = {
ZEND_GET_MODULE(expect)
#endif

#ifdef ZEND_ENGINE_2
#define OnUpdateInt OnUpdateLong
#endif

/* {{{ PHP_INI_MH
* */
static PHP_INI_MH(OnSetExpectTimeout)
{
return OnUpdateInt (entry, new_value, new_value_length, &exp_timeout, mh_arg2, mh_arg3, stage TSRMLS_CC);
if (new_value) {
exp_timeout = atoi(new_value);
}
}
/* }}} */

Expand All @@ -66,7 +64,13 @@ static PHP_INI_MH(OnSetExpectTimeout)
* */
static PHP_INI_MH(OnSetExpectLogUser)
{
return OnUpdateBool (entry, new_value, new_value_length, &exp_loguser, mh_arg2, mh_arg3, stage TSRMLS_CC);
if (new_value) {
if (strncasecmp("on", new_value, sizeof("on"))) {
exp_loguser = atoi(new_value);
} else {
exp_loguser = 1;
}
}
}
/* }}} */

Expand Down

0 comments on commit 743dadd

Please sign in to comment.