Closed Bug 45018 Opened 26 years ago Closed 25 years ago

Sometimes Mozilla crashes on createEntityReference(...) method of DocumentImpl class

Categories

(Core Graveyard :: Java APIs for DOM, defect, P3)

x86
Windows NT

Tracking

(Not tracked)

VERIFIED FIXED

People

(Reporter: rmv, Assigned: ashuk)

Details

(Keywords: crash)

Attachments

(1 file)

Overview Description: In some cases createEntityReference(...) method of DocumentImpl crashes Mozilla. Steps to Reproduce: Run the following JavaDOM API testcase in the XML mode: org.mozilla.dom.test.DocumentImpl_createEntityReference_String_1 Actual Results: Mozilla crashes. Expected Results: Method should work OK. Build Date & Platform Bug Found: 07/10/2000 Windows NT 4.0 Additional Information: In some cases NS_IMETHOD CreateEntityReference(const nsString& aName, nsIDOMEntityReference** aReturn) method of nsIDOMDocument class returns NS_OK though aReturn parameter is NULL. Therefore we need to check it for NULL before trying to access. Thus the following code in java/dom/jni/org_mozilla_dom_DocumentImpl.cpp file should be corrected: 315 nsresult rv = doc->CreateEntityReference(*name, &ret); 316 nsString::Recycle(name); 317 318 if (NS_FAILED(rv)) { 319 JavaDOMGlobals::ExceptionType exceptionType = JavaDOMGlobals::EXCEPTION_RUNTIME; 320 if (NS_ERROR_GET_MODULE(rv) == NS_ERROR_MODULE_DOM && 321 (rv == NS_ERROR_DOM_INVALID_CHARACTER_ERR || 322 rv == NS_ERROR_DOM_NOT_SUPPORTED_ERR)) { 323 exceptionType = JavaDOMGlobals::EXCEPTION_DOM; 324 } 325 JavaDOMGlobals::ThrowException(env, 326 "Document.createEntityReference: failed", rv, exceptionType); 327 return NULL; 328 } 329 ... 343 344 ret->AddRef();
Adding crash keyword.
Keywords: crash
assigning to Denis Sharypov, the real owner of java dom.
Assignee: akhil.arora → sdv
hopefully george will try to find a new owner for this bug
Assignee: sdv → drapeau
Ashu is taking ownership of JavaDOM bugs. Re-assigning to him.
Assignee: drapeau → ashuk
Attached patch cvs diff of fix. — — Splinter Review
Status: NEW → ASSIGNED
fix checked in. Michail/Alexei, pls test with the JavaDOM testsuite and confirm that the patch fixes the problem.
Status: ASSIGNED → RESOLVED
Closed: 25 years ago
Resolution: --- → FIXED
Looks like it isn't reproduced now.
Marking verified according to Vladimir's info.
Status: RESOLVED → VERIFIED
Product: Core → Core Graveyard
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: