php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #20234 zend_parse_parameters() problem
Submitted: 2002-11-03 21:14 UTC Modified: 2002-11-04 05:40 UTC
Votes:1
Avg. Score:5.0 ± 0.0
Reproduced:0 of 0 (0.0%)
From: nicos@php.net Assigned:
Status: Not a bug Package: Scripting Engine problem
PHP Version: 4.3.0-pre2 OS: FreeBSD 4.7
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: nicos@php.net
New email:
PHP Version: OS:

 

 [2002-11-03 21:14 UTC] 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.

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2002-11-03 21:34 UTC] nicos@php.net
I also get:

Program received signal SIGSEGV, Segmentation fault.
0x08126fc7 in zend_parse_arg_impl ()

 [2002-11-04 05:40 UTC] wez@php.net
Don't use "zval **", use "zval *" like it says in the docs.
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Wed Sep 10 00:00:02 2025 UTC