ProxyJNI::GetField implementation is wrong

RESOLVED DUPLICATE of bug 213032

Status

Core Graveyard
Java: OJI
RESOLVED DUPLICATE of bug 213032
15 years ago
8 years ago

People

(Reporter: Xiaobin Lu, Assigned: Joshua Xia)

Tracking

Firefox Tracking Flags

(Not tracked)

Details

(Reporter)

Description

15 years ago
User-Agent:       Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; .NET CLR 1.1.4322)
Build Identifier: 

static jvalue GetField(JNIEnv* env, jobject obj, JNIField* field)
    {
        jvalue outValue;
        ProxyJNIEnv& proxyEnv = GetProxyEnv(env);
        nsISecureEnv* secureEnv = GetSecureEnv(env);
        nsISecurityContext* securityContext = proxyEnv.getContext();
        nsresult rv = secureEnv->GetField(field->mFieldType, obj, field-
>mFieldID, &outValue, securityContext);
        NS_IF_RELEASE(securityContext);
        return NS_SUCCEEDED(rv) ? outValue : kErrorValue;
    }

#define IMPLEMENT_GET_FIELD(methodName, returnType, 
jvalueField)                            \
    static returnType JNICALL methodName(JNIEnv *env, jobject obj, jfieldID 
fieldID)        \
    
{                                                                               
        \
        return GetField(env, obj, (JNIField*)
fieldID).jvalueField;                          \
    }                                                                           
            \

The GetField is called from Liveconnect module and the last parameter pointer 
passed from liveconect is jfieldID, but OJI casted it into JNIField which is 
totally wrong

Reproducible: Always

Steps to Reproduce:
1. Access http://javaweb.sfbay/~xl116366/LCTest/JavaArray/TavaArrayTest.html
2. Click the button
3. The pop up box displays nothing



Expected Results:  
It should print out the value

Comment 1

15 years ago

*** This bug has been marked as a duplicate of 213032 ***
Status: NEW → RESOLVED
Last Resolved: 15 years ago
Resolution: --- → DUPLICATE

Updated

8 years ago
Component: Java: OJI → Java: OJI
Product: Core → Core Graveyard
You need to log in before you can comment on or make changes to this bug.