Closed Bug 174151 Opened 22 years ago Closed 22 years ago

null entry for editor type in MakeWindowEditable() results in crash

Categories

(Core :: DOM: Editor, defect)

x86
Windows XP
defect
Not set
critical

Tracking

()

VERIFIED FIXED

People

(Reporter: depman1, Assigned: cmanske)

References

()

Details

(Keywords: crash, topembed+, Whiteboard: [adt2])

Mozilla 1.2b Mozilla/5.0 (Windows; U; WinNT4.0; en-US; rv:1.2b) Gecko/20021012.
Build instructions for TestEmbed at:
http://lxr.mozilla.org/seamonkey/source/embedding/qa/testembed/README.TXT#170

1. Pass NULL or nsnull into aEditorType (2nd parameter) in
nsIEditingSession->MakeWindowEditable(). 
2. Launch embedding app (TestEmbed).
3. Select MakeWindowEditable test (in TestEmbed, Interfaces > nsIEditingSession
> MakeWindowEditable() ).
Result: unhandled exception crash. Crashing in nsEditingSession.cpp line 77.

Stack trace:
strcmp() line 77
nsEditingSession::MakeWindowEditable(nsEditingSession * const 0x0306bd50,
nsIDOMWindow * 0x00e31774, const char * 0x00000000, int 0) line 135 + 14 bytes
CnsIEditSession::MakeWinEditTest(int 0) line 101 + 44 bytes
CnsIEditSession::OnStartTests(unsigned int 32968) line 173
CTests::OnInterfacesNsieditingsession() line 906
_AfxDispatchCmdMsg(CCmdTarget * 0x00e7ee50 {CTests hWnd=0x00000000}, unsigned
int 32968, int 0, void (void)* 0x00401aff
CTests::OnInterfacesNsieditingsession(void), void * 0x00000000, unsigned int 12,
AFX_CMDHANDLERINFO * 0x00000000) line 88
CCmdTarget::OnCmdMsg(unsigned int 32968, int 0, void * 0x00000000,
AFX_CMDHANDLERINFO * 0x00000000) line 302 + 39 bytes
CTests::OnCmdMsg(unsigned int 32968, int 0, void * 0x00000000,
AFX_CMDHANDLERINFO * 0x00000000) line 818
CBrowserView::OnCmdMsg(unsigned int 32968, int 0, void * 0x00000000,
AFX_CMDHANDLERINFO * 0x00000000) line 1062 + 42 bytes
CBrowserFrame::OnCmdMsg(unsigned int 32968, int 0, void * 0x00000000,
AFX_CMDHANDLERINFO * 0x00000000) line 280 + 37 bytes
CWnd::OnCommand(unsigned int 32968, long 0) line 2088
CFrameWnd::OnCommand(unsigned int 32968, long 0) line 321
CWnd::OnWndMsg(unsigned int 273, unsigned int 32968, long 0, long * 0x0012fd98)
line 1597 + 28 bytes
CWnd::WindowProc(unsigned int 273, unsigned int 32968, long 0) line 1585 + 30 bytes
AfxCallWndProc(CWnd * 0x01046260 {CBrowserFrame hWnd=0x00060416}, HWND__ *
0x00060416, unsigned int 273, unsigned int 32968, long 0) line 215 + 26 bytes
AfxWndProc(HWND__ * 0x00060416, unsigned int 273, unsigned int 32968, long 0)
line 368
AfxWndProcBase(HWND__ * 0x00060416, unsigned int 273, unsigned int 32968, long
0) line 220 + 21 bytes
USER32! 77e71820()
actually looks like it's choking in nsEditingSession::MakeWindowEditable() line
135, going into the 'if' segments. No crash if we enter 'text' for editorType param.
Assignee: kin → mjudge
Keywords: crash
QA Contact: sujay → depstein
Keywords: topembed
Topembed+ per EDT triage.
Keywords: topembedtopembed+
Whiteboard: [adt2]
Fixed with recent changes in nsEditingSession::MakeWindowEditable(). It's now
setting a default editor type for an undefined type (i.e. nsnull or NULL). Then
assigns explicitly to mEditorType: 

if (!aEditorType)
     aEditorType = DEFAULT_EDITOR_TYPE;
mEditorType = aEditorType;

http://lxr.mozilla.org/seamonkey/source/editor/composer/src/nsEditingSession.cpp#156
This was done in Rev 1.5.
Assignee: mjudge → cmanske
Fixed by recent checkins 
Status: NEW → RESOLVED
Closed: 22 years ago
Resolution: --- → FIXED
verified in 11/20/02 mozilla trunk.
Status: RESOLVED → VERIFIED
You need to log in before you can comment on or make changes to this bug.