From: Michael Wallner Date: Thu, 3 Apr 2008 13:25:03 +0000 (+0000) Subject: fix segv with invalid url X-Git-Tag: RELEASE_1_6_1~6 X-Git-Url: https://git.m6w6.name/?a=commitdiff_plain;h=bd039a8d0770283c0d8c1e382af5462b9da4d03d;p=m6w6%2Fext-http fix segv with invalid url --- diff --git a/http_request_object.c b/http_request_object.c index f9bbf5e..2293041 100644 --- a/http_request_object.c +++ b/http_request_object.c @@ -549,12 +549,16 @@ static inline void _http_request_object_check_request_content_type(zval *this_pt STATUS _http_request_object_requesthandler(http_request_object *obj, zval *this_ptr TSRMLS_DC) { STATUS status = SUCCESS; + char *url = http_absolute_url(Z_STRVAL_P(zend_read_property(THIS_CE, getThis(), ZEND_STRS("url")-1, 0 TSRMLS_CC))); + if (!url) { + return FAILURE; + } + http_request_reset(obj->request); + obj->request->url = url; HTTP_CHECK_CURL_INIT(obj->request->ch, http_curl_init(obj->request), return FAILURE); - obj->request->url = http_absolute_url(Z_STRVAL_P(zend_read_property(THIS_CE, getThis(), ZEND_STRS("url")-1, 0 TSRMLS_CC))); - switch (obj->request->meth = Z_LVAL_P(zend_read_property(THIS_CE, getThis(), ZEND_STRS("method")-1, 0 TSRMLS_CC))) { case HTTP_GET: