X-Git-Url: https://git.m6w6.name/?p=m6w6%2Fext-http;a=blobdiff_plain;f=src%2Fphp_http_url.c;h=2332fb55b8382572312dc9382c091bc4c15b67c2;hp=b828c46a817a904db182db4b108c509a0f954275;hb=b2be5b163e896bb9cbb3f28314551d0debf8408d;hpb=40d6f0ca483e19b18982d135e5ea2c7426e832a6 diff --git a/src/php_http_url.c b/src/php_http_url.c index b828c46..2332fb5 100644 --- a/src/php_http_url.c +++ b/src/php_http_url.c @@ -503,7 +503,7 @@ php_http_url_t *php_http_url_from_struct(HashTable *ht) HashTable *php_http_url_to_struct(const php_http_url_t *url, zval *strct) { - HashTable *ht; + HashTable *ht = NULL; zval tmp; if (strct) { @@ -523,8 +523,8 @@ HashTable *php_http_url_to_struct(const php_http_url_t *url, zval *strct) } #define url_struct_add(part) \ - if (Z_TYPE_P(strct) == IS_ARRAY) { \ - zend_hash_str_update(Z_ARRVAL_P(strct), part, lenof(part), &tmp); \ + if (!strct || Z_TYPE_P(strct) == IS_ARRAY) { \ + zend_hash_str_update(ht, part, lenof(part), &tmp); \ } else { \ zend_update_property(Z_OBJCE_P(strct), strct, part, lenof(part), &tmp); \ zval_ptr_dtor(&tmp); \