#20234 [Opn->Bgs]: zend_parse_parameters() problem
| From: | wez@php.net | Date: | Mon, 04 Nov 2002 11:40:04 +0000 |
| Subject: | #20234 [Opn->Bgs]: zend_parse_parameters() problem | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-24029@lists.php.net to get a copy of this message | ||
ID: 20234
Updated by: wez@php.net
Reported By: nicos@php.net
-Status: Open
+Status: Bogus
Bug Type: Zend Engine 2 problem
Operating System: FreeBSD 4.7
PHP Version: 4.3.0-pre2
New Comment:
Don't use "zval **", use "zval *" like it says in the docs.
Previous Comments:
------------------------------------------------------------------------
[2002-11-03 21:34:36] nicos@php.net
I also get:
Program received signal SIGSEGV, Segmentation fault.
0x08126fc7 in zend_parse_arg_impl ()
------------------------------------------------------------------------
[2002-11-03 21:14:36] nicos@php.net
After making some extensions, I found at the doc that
zend_get_parameters_ex() was supposed to be depreciated. As the doc is
saying, I passed my script to zend_parse_parameters(). It works fine
with zval*, long, double etc... But It looks it segfaults with a
zval**.
ZEND_FUNCTION(calculhmac)
{
zval **clent, **data;
char *result;
char *iclent, *idata;
if (zend_parse_parameters(2, "zz", &clent, &data) == FAILURE) {
WRONG_PARAM_COUNT;
}
convert_to_string_ex(clent);
convert_to_string_ex(data);
iclent = Z_STRVAL_PP(clent);
idata = Z_STRVAL_PP(data);
result = sp_CalculHmac(iclent, idata);
RETURN_STRING(result, 1);
}
Note that it works fine with get and that parse is supposed to replace
get...
Here is the gdb report:
Program received signal SIGSEGV, Segmentation fault.
0x4011baeb in strlen (str=0x0) at ../sysdeps/i386/strlen.c:28
28 ../sysdeps/i386/strlen.c: No such file or directory.
in ../sysdeps/i386/strlen.c
Thanks to verify that before closing.
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=20234&edit=1