From: Michael Wallner Date: Thu, 20 Aug 2009 11:20:23 +0000 (+0000) Subject: fixed pecl bug #14382 PHP crash after casting scalar argument to an array in... X-Git-Tag: RELEASE_1_7_0b2~17 X-Git-Url: https://git.m6w6.name/?a=commitdiff_plain;h=45e3585d76a18cdc4cbfe0a461ddd2a8918dca93;p=m6w6%2Fext-http fixed pecl bug #14382 PHP crash after casting scalar argument to an array in HttpQueryString --- diff --git a/http_querystring_api.c b/http_querystring_api.c index 4fc3986..e6b557a 100644 --- a/http_querystring_api.c +++ b/http_querystring_api.c @@ -161,6 +161,11 @@ static inline int _http_querystring_modify_array(zval *qarray, zval *params TSRM static inline int _http_querystring_modify_array_ex(zval *qarray, int key_type, char *key, int keylen, ulong idx, zval *params_entry TSRMLS_DC) { zval **qarray_entry; + + /* ensure array type */ + if (Z_TYPE_P(qarray) != IS_ARRAY) { + convert_to_array(qarray); + } /* delete */ if (Z_TYPE_P(params_entry) == IS_NULL) {