Hi,
On Fri, 2014-09-05 at 05:05 -0700, Boro Sitnikovski wrote:
> Hi Johannes,
>
> Thanks for the remarks. I've pushed a new commit that fixes them.
PHP_FUNCTION(xmp_create_context)
{
/* ... */
xmp = xmp_create_context();
memcpy(xmp_ptr, &xmp, sizeof(xmp_context));
if (xmp) {
ZEND_REGISTER_RESOURCE(return_value, xmp_ptr, le_xmp);
} else {
RETURN_FALSE;
}
}
this still looks suspicious to me. You always copy contents of xmp to
xmp_ptr and only later check value of xmp. Quick look at docs tells me
that xmp_create_context() apparently can't report an error and something
like this might be enough:
PHP_FUNCTION(xmp_create_context)
{
xmp_context *xmp;
if (zend_parse_parameters_none() == FAILURE) {
return;
}
xmp = emalloc(sizeof(xmp_context));
*xmp = xmp_create_context();
ZEND_REGISTER_RESOURCE(return_value, xmp, le_xmp);
}
> I requested a PECL account using that form.
Creating the repo is in the works.
johannes
--
PECL development discussion Mailing List (http://pecl.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php