Verify that a classname is actually passed on a new Java() call.

This commit is contained in:
Sam Ruby 2000-07-22 16:13:20 +00:00
parent 3e4a4f2376
commit 7893c72965
2 changed files with 14 additions and 2 deletions

View File

@ -434,9 +434,15 @@ void java_call_function_handler
jmethodID co = (*jenv)->GetMethodID(jenv, JG(reflect_class), "CreateObject",
"(Ljava/lang/String;[Ljava/lang/Object;J)V");
jstring className=(*jenv)->NewStringUTF(jenv, arguments[0]->value.str.val);
jstring className;
(pval*)(long)result = object;
if (ZEND_NUM_ARGS() < 1) {
php_error(E_ERROR, "Missing classname in new Java() call");
return;
}
className=(*jenv)->NewStringUTF(jenv, arguments[0]->value.str.val);
(*jenv)->CallVoidMethod(jenv, JG(php_reflect), co,
className, _java_makeArray(arg_count-1, arguments+1 JG_CC), result);

View File

@ -434,9 +434,15 @@ void java_call_function_handler
jmethodID co = (*jenv)->GetMethodID(jenv, JG(reflect_class), "CreateObject",
"(Ljava/lang/String;[Ljava/lang/Object;J)V");
jstring className=(*jenv)->NewStringUTF(jenv, arguments[0]->value.str.val);
jstring className;
(pval*)(long)result = object;
if (ZEND_NUM_ARGS() < 1) {
php_error(E_ERROR, "Missing classname in new Java() call");
return;
}
className=(*jenv)->NewStringUTF(jenv, arguments[0]->value.str.val);
(*jenv)->CallVoidMethod(jenv, JG(php_reflect), co,
className, _java_makeArray(arg_count-1, arguments+1 JG_CC), result);