zend_object *php_http_encoding_stream_object_clone(zval *object)
{
- php_http_encoding_stream_object_t *new_obj = NULL, *old_obj = PHP_HTTP_OBJ(NULL, object);
+ php_http_encoding_stream_object_t *new_obj, *old_obj = PHP_HTTP_OBJ(NULL, object);
php_http_encoding_stream_t *cpy = php_http_encoding_stream_copy(old_obj->stream, NULL);
new_obj = php_http_encoding_stream_object_new_ex(old_obj->zo.ce, cpy);
PHP_HTTP_INFO(info).response.code = 0;
}
if (EXPECTED(status && end > status)) {
- while (' ' == *status) ++status;
+ while (' ' == *status && end > status) ++status;
PHP_HTTP_INFO(info).response.status = estrndup(status, end - status);
} else {
PHP_HTTP_INFO(info).response.status = NULL;
PHP_HTTP_INFO(info).request.method = estrndup(pre_header, url_len);
- while (' ' == *url) ++url;
+ while (' ' == *url && http > url) ++url;
while (' ' == *(http-1)) --http;
if (EXPECTED(http > url)) {
zend_object *php_http_message_object_clone(zval *this_ptr)
{
- php_http_message_object_t *new_obj = NULL;
+ php_http_message_object_t *new_obj;
php_http_message_object_t *old_obj = PHP_HTTP_OBJ(NULL, this_ptr);
new_obj = php_http_message_object_new_ex(old_obj->zo.ce, php_http_message_copy(old_obj->message, NULL));
zend_object *php_http_message_body_object_clone(zval *object)
{
- php_http_message_body_object_t *new_obj = NULL;
+ php_http_message_body_object_t *new_obj;
php_http_message_body_object_t *old_obj = PHP_HTTP_OBJ(NULL, object);
php_http_message_body_t *body = php_http_message_body_copy(old_obj->body, NULL);
static void sanitize_dimension(zval *zv)
{
- zval arr, tmp, *cur = NULL;
+ zval arr, tmp, *cur = &arr;
char *var = NULL, *ptr = Z_STRVAL_P(zv), *end = Z_STRVAL_P(zv) + Z_STRLEN_P(zv);
long level = 0;
array_init(&arr);
- cur = &arr;
while (ptr < end) {
if (!var) {