if (NULL != (tmp = zend_hash_str_find(Z_ARRVAL_P(server_params),
"Server", sizeof("Server")-1))) {
- convert_to_string_ex(tmp);
+ if (!try_convert_to_string(tmp)) {
+ return;
+ }
server_name = Z_STRVAL_P(tmp);
server_name_len = Z_STRLEN_P(tmp);
ctx = CLSCTX_REMOTE_SERVER;
if (NULL != (tmp = zend_hash_str_find(Z_ARRVAL_P(server_params),
"Username", sizeof("Username")-1))) {
- convert_to_string_ex(tmp);
+ if (!try_convert_to_string(tmp)) {
+ return;
+ }
user_name = Z_STRVAL_P(tmp);
user_name_len = Z_STRLEN_P(tmp);
}
if (NULL != (tmp = zend_hash_str_find(Z_ARRVAL_P(server_params),
"Password", sizeof("Password")-1))) {
- convert_to_string_ex(tmp);
+ if (!try_convert_to_string(tmp)) {
+ return;
+ }
password = Z_STRVAL_P(tmp);
password_len = Z_STRLEN_P(tmp);
}
if (NULL != (tmp = zend_hash_str_find(Z_ARRVAL_P(server_params),
"Domain", sizeof("Domain")-1))) {
- convert_to_string_ex(tmp);
+ if (!try_convert_to_string(tmp)) {
+ return;
+ }
domain_name = Z_STRVAL_P(tmp);
domain_name_len = Z_STRLEN_P(tmp);
}
if ((tmp = zend_hash_index_find(Z_ARRVAL_P(sink), 1)) != NULL && Z_TYPE_P(tmp) == IS_STRING)
dispname = Z_STRVAL_P(tmp);
} else if (sink != NULL) {
- convert_to_string(sink);
+ if (!try_convert_to_string(sink)) {
+ return;
+ }
dispname = Z_STRVAL_P(sink);
}
obj = CDNO_FETCH(object);
if (V_VT(&obj->v) == VT_DISPATCH) {
- VariantInit(&v);
+ if (!try_convert_to_string(member)) {
+ return rv;
+ }
- convert_to_string_ex(member);
+ VariantInit(&v);
res = php_com_do_invoke(obj, Z_STRVAL_P(member), Z_STRLEN_P(member),
DISPATCH_METHOD|DISPATCH_PROPERTYGET, &v, 0, NULL, 1);
obj = CDNO_FETCH(object);
if (V_VT(&obj->v) == VT_DISPATCH) {
+ if (!try_convert_to_string(member)) {
+ return value;
+ }
+
VariantInit(&v);
- convert_to_string_ex(member);
if (SUCCESS == php_com_do_invoke(obj, Z_STRVAL_P(member), Z_STRLEN_P(member),
DISPATCH_PROPERTYPUT|DISPATCH_PROPERTYPUTREF, &v, 1, value, 0)) {
VariantClear(&v);
obj = CDNO_FETCH(object);
if (V_VT(&obj->v) == VT_DISPATCH) {
- convert_to_string_ex(member);
+ if (!try_convert_to_string(member)) {
+ return 0;
+ }
if (SUCCEEDED(php_com_get_id_of_name(obj, Z_STRVAL_P(member), Z_STRLEN_P(member), &dispid))) {
/* TODO: distinguish between property and method! */
return 1;
}
ZVAL_COPY_VALUE(&args[i-1], offset);
- convert_to_string(&proxy->indices[0]);
+ if (!try_convert_to_string(&proxy->indices[0])) {
+ efree(args);
+ return rv;
+ }
VariantInit(&v);
res = php_com_do_invoke(proxy->obj, Z_STRVAL(proxy->indices[0]),
ZVAL_COPY_VALUE(&args[i-1], offset);
ZVAL_COPY_VALUE(&args[i], value);
- convert_to_string(&proxy->indices[0]);
+ if (!try_convert_to_string(&proxy->indices[0])) {
+ efree(args);
+ return;
+ }
VariantInit(&v);
if (SUCCESS == php_com_do_invoke(proxy->obj, Z_STRVAL(proxy->indices[0]),
Z_STRLEN(proxy->indices[0]), DISPATCH_PROPERTYPUT, &v, proxy->dimensions + 1,