From: Michael Wallner Date: Tue, 8 Jul 2014 10:11:29 +0000 (+0200) Subject: ensure the response message is actually of type response X-Git-Tag: RELEASE_2_0_7~23 X-Git-Url: https://git.m6w6.name/?p=m6w6%2Fext-http;a=commitdiff_plain;h=1383635acbd8c6a1e4f747d0d1960f625c1c02a2 ensure the response message is actually of type response it could be uninitialized in case of early error, like DNS fixes bug #67584 --- diff --git a/php_http_client.c b/php_http_client.c index 489177b..8a166fc 100644 --- a/php_http_client.c +++ b/php_http_client.c @@ -390,6 +390,9 @@ static STATUS handle_response(void *arg, php_http_client_t *client, php_http_cli zval *info, *zresponse, *zrequest; HashTable *info_ht; + /* ensure the message is of type response (could be uninitialized in case of early error, like DNS) */ + php_http_message_set_type(msg, PHP_HTTP_RESPONSE); + if (z_is_true(zend_read_property(php_http_client_class_entry, &zclient, ZEND_STRL("recordHistory"), 0 TSRMLS_CC))) { handle_history(&zclient, *request, *response TSRMLS_CC); }