Closed
Bug 44462
Opened 25 years ago
Closed 25 years ago
Wrong url loaded by Webclient in some cases
Categories
(Core Graveyard :: Java APIs to WebShell, defect, P3)
Tracking
(Not tracked)
VERIFIED
FIXED
People
(Reporter: avm, Assigned: edburns)
Details
Attachments
(2 files)
|
1.13 KB,
application/octet-stream
|
Details | |
|
2.39 KB,
patch
|
Details | Diff | Splinter Review |
In some cases the test application, that uses Webclient API loads URLs with some
garbage. For exmple when i try to load "www.sun.com/" via Navigation.loadURL
then really "www.sun.com/sdajkfgas_SomeGarbage_dfrfdf" loaded.
Supposed reason:
When constructing wsLoadURLEvent webclient use the buffer of PRUnichar to
construct nsString.
But early this PRUnichar array was recieved via env->GetStringChars(inString,0)
and may be or may be NOT 0-terminated. And when constructing nsString from
not 0-terminated string we can get some GARBAGE from memory.
This problem is well reproduced with jdk1.2.2SE, latest Webclient and Mozilla
M16.
Also this problem can be reproduced with jdk1.2.2 and Mozilla M13
I can't reproduce this. And your explanation doesn't fit the code. We just
get back a string:
PRUnichar* urlStringChars = (PRUnichar *) ::util_GetStringChars(env,
urlString);
This goes to env->GetStringChars(). We have no control over what this returns.
If there is garbage, it's a JNI bug.
Can you please help me reproduce this?
Status: ASSIGNED → RESOLVED
Closed: 25 years ago
Resolution: --- → WORKSFORME
| Reporter | ||
Comment 3•25 years ago
|
||
Yes, this bug is hard to reproduce. But this is not jni bug, but
documented jni feature: env->GetStringChars() can return
0-terminated OR not 0-terminated array.
And in our case we must use additional "length" parameter to construct
right nsString from PRUnichar array.
In attachment please see the simple jni testcase, that shows that
array, returned by env->GetStringChars is not 0-terminated.
To run this testcase please untar it, build under win32 and run NativeTest
class.
| Reporter | ||
Comment 4•25 years ago
|
||
| Reporter | ||
Comment 5•25 years ago
|
||
Additional info: testcase from 07/31/00 05:39 in .tar.gz format
| Reporter | ||
Comment 6•25 years ago
|
||
The fix looks fine, but the only thing that remains is to make it compatible
with webclient in StarOffice. I can do that.
Status: RESOLVED → REOPENED
Resolution: WORKSFORME → ---
Fix checked in.
Status: REOPENED → RESOLVED
Closed: 25 years ago → 25 years ago
Resolution: --- → FIXED
| Reporter | ||
Comment 10•24 years ago
|
||
VERIFIED with JAVADEV_6_1_20010831 and Netscape61_RELEASE.
Status: RESOLVED → VERIFIED
Updated•24 years ago
|
QA Contact: geetha.vaidyanaathan → avm
Updated•13 years ago
|
Product: Core → Core Graveyard
You need to log in
before you can comment on or make changes to this bug.
Description
•