Closed Bug 32484 Opened 25 years ago Closed 25 years ago

bad cast in nsWebShell::GetLinkState (mozilla/webshell/src/nsWebShell.cpp)

Categories

(Core :: Internationalization, defect, P3)

x86
All
defect

Tracking

()

VERIFIED FIXED

People

(Reporter: m_kato, Assigned: travis)

References

Details

REPRO STEP ========== o open japanese filename via [File] - [Open File...] DESCRIPTION =========== NS_IMETHODIMP nsWebShell::GetLinkState(const PRUnichar* aURLSpec, nsLinkState& aState) { (omit) if (mHistoryService) { // XXX aURLSpec should really be a char*, not a PRUnichar*. nsAutoString urlStr(aURLSpec); char buf[256]; char* url = buf; if (urlStr.Length() >= PRInt32(sizeof buf)) { url = new char[urlStr.Length() + 1]; } PRInt64 lastVisitDate; if (url) { urlStr.ToCString(url, urlStr.Length() + 1); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ This problem is urlStr.ToCStinrg(). It should use urlStr.ToNewUTF8String(). STACK TRACE =========== >k 000000000012e704 0000000010012d0c NTDLL!DbgBreakPoint 000000000012e70c 0000000010012c79 XPCOM!nsDebug::Break+0x5c(0x100A8978, 0x0000013A) 000000000012efbc 000000001002daa9 XPCOM!nsDebug::Assertion+0x119(0x100A89B8, 0x100A89A8, 0x100A8978, 0x0000013A) 000000000012efe8 000000001002ecb6 XPCOM!CopyChars2To1+0xd9(0x0012F1A0, 0x00000000, 0x0012F114, 0x00000000, 0x00000022) 000000000012f018 000000001002ebce XPCOM!nsStr::Append+0xd6({...}, {...}, 0x00000000, 0x00000022) 000000000012f030 000000001001a05f XPCOM!nsStr::Assign+0x2e({...}, {...}, 0x00000000, 0x00000022) 000000000012f058 0000000010015e7a XPCOM!nsCString::Assign+0x9f({...}, 0x00000022) 000000000012f0e0 000000000035a44a XPCOM!nsString::ToCString+0x5a(0x0012F1A0, 0x00000023, 0x00000000) 000000000012f2a4 0000000001e3bf80 GKWEB!nsWebShell::GetLinkState+0xeb(0x01993814, 0x0012F2E4, 0x00000000) 000000000012f5ac 0000000001e3b2d2 GKHTML!SelectorMatches+0xbe0(0x03D3F730, 0x016CE89C, 0x03D449AC, 0x00000001) 000000000012f5d0 0000000001e37772 GKHTML!ContentEnumFunc+0x32(0x016CE890, 0x0012F65C) 000000000012f638 0000000001e3b20d GKHTML!RuleHash::EnumerateAllRules+0x312(0x016946D0, 0x00000000, {...}, 0x01E3B2A0, 0x0012F65C) 000000000012f6a4 0000000001d39410 GKHTML!CSSRuleProcessor::RulesMatching+0x13d(0x03D37B50, 0x03D3F730, 0x0169BE70, 0x03D449AC, 0x03879280, 0x03D45200) 000000000012f6cc 000000001001cf62 GKHTML!EnumRulesMatching+0x40(0x03D37B50, 0x0012F710) 000000000012f6e4 0000000001d391e1 XPCOM!nsSupportsArray::EnumerateForwards+0x42(0x03D37B00, 0x01D393D0, 0x0012F710) 000000000012f730 0000000001d6a83c GKHTML!StyleSetImpl::ResolveStyleFor+0xf1(0x03D3F730, 0x03D449AC, 0x03879280, 0x00000000) 000000000012f760 0000000001e47dae GKHTML!nsPresContext::ResolveStyleContextFor+0xbc(0x03D3F730, 0x03D449AC, 0x03879280, 0x00000000, 0x0012F7EC) 000000000012f7a8 0000000001e47e6d GKHTML!nsCSSFrameConstructor::ResolveStyleContext+0x1de(0x03D3F730, 0x03873688, 0x03D449AC, 0x016946D0, 0x0012F7EC) 000000000012f7f8 0000000001e491b3 GKHTML!nsCSSFrameConstructor::ConstructFrame+0x9d(0x01A0BD18, 0x03D3F730, {...}, 0x03D449AC, 0x03873688, {...}) 000000000012f934 0000000001d39ed1 GKHTML!nsCSSFrameConstructor::ContentAppended+0x6e3(0x03D32980, 0x03D3F730, 0x03D37A98, 0x00000000) 000000000012f94c 0000000001d959fa GKHTML!StyleSetImpl::ContentAppended+0x21(0x03D328E0, 0x03D3F730, 0x03D37A98, 0x00000000) 000000000012f970 0000000001ed80ca GKHTML!PresShell::ContentAppended+0x5a(0x01A0BD20, 0x03D3DB40, 0x03D37A98, 0x00000000) 000000000012f990 0000000001df03f0 GKHTML!nsDocument::ContentAppended+0x5a(0x03D3DB40, 0x03D37A98, 0x00000000) 000000000012f9ac 0000000001de4293 GKHTML!nsHTMLDocument::ContentAppended+0xa0(0x03D3DB40, 0x03D37A98, 0x00000000) 000000000012f9c4 0000000001dde5bf GKHTML!HTMLContentSink::NotifyAppend+0x33(0x03D37A98, 0x00000000) 000000000012fac8 0000000001de0c41 GKHTML!SinkContext::FlushTags+0x36f(0x00000001) 000000000012fadc 00000000020e4910 GKHTML!HTMLContentSink::CloseBody+0x81(0x03D3E710, {...}) 000000000012faf8 00000000020e4eff GKPARSER!CNavDTD::CloseBody+0x28(0x03D378C0) 000000000012fb18 00000000020e50a1 GKPARSER!CNavDTD::CloseContainer+0x7f(0x03D378C0, 0x0000000F, 0x00000000) 000000000012fb4c 00000000020e52b7 GKPARSER!CNavDTD::CloseContainersTo+0xb5(0x00000001, 0x0000000F, 0x00000000) 000000000012fb88 00000000020e1b06 GKPARSER!CNavDTD::CloseContainersTo+0x63(0x0000000F, 0x00000000) 000000000012fbd8 00000000020f84fc GKPARSER!CNavDTD::DidBuildModel+0x17a(0x03834460, 0x00000000, 0x00000001, 0x019C1CF0, 0x03D3E710) 000000000012fbfc 00000000020f928a GKPARSER!nsParser::DidBuildModel+0x71(0x00000000) 000000000012fc38 00000000020f9db2 GKPARSER!nsParser::ResumeParse+0x20b(0x00000001, 0x00000001) 000000000012fce4 0000000002cd2ca6 GKPARSER!nsParser::OnStopRequest+0xba(0x019C1CF4, 0x03D319C0, 0x00000000, 0x00000000, 0x00000000) 000000000012fd08 00000000027336f8 URILDR!nsDocumentOpenInfo::OnStopRequest+0x46(0x03D31E30, 0x03D319C0, 0x00000000, 0x00000000, 0x00000000) 000000000012fd30 000000000267ae5f NKFILE!nsFileChannel::OnStopRequest+0x33(0x03D319C4, 0x03D22570, 0x00000000, 0x00000000, 0x00000000) 000000000012fd54 000000000267a5c1 NECKO!nsOnStopRequestEvent::HandleEvent+0x9f(0x03D36F50) 000000000012fd68 000000001005dc49 NECKO!nsStreamListenerEvent::HandlePLEvent+0x41(0x03D36F90) 000000000012fd7c 000000001005db07 XPCOM!PL_HandleEvent+0x49(0x03D36F90) 000000000012fd90 000000001005e047 XPCOM!PL_ProcessPendingEvents+0x87(0x0167E6D0) 000000000012fda0 0000000077e41213 XPCOM!md_EventReceiverProc+0x27(0x015401A2, 0x0000C0ED, 0x00000000, 0x0167E6D0) 000000000012fdcc 0000000077e420e2 USER32!DispatchMessageWorker+0xa2 000000000012fdd8 0000000002ec27ef USER32!DispatchMessageA+0xb 000000000012fe30 0000000001aa3a8a GKWIDGET!nsAppShell::Run+0xef(0x0167F6D0) 000000000012fe3c 0000000000402faf APPSHELL!nsAppShellService::Run+0x15(0x0167E120) 000000000012ff14 00000000004026e8 MOZILLA!main1+0x64f(0x00000001, 0x014043F0, 0x00000000) 000000000012ff70 0000000000408c6f MOZILLA!main+0x228(0x00000001, 0x014043F0) 000000000012ffc0 0000000077eebd1e MOZILLA!mainCRTStartup+0xff(...) 000000000012fff0 0000000000000000 KERNEL32!BaseProcessStart+0x40
Blocks: 28424
Status: UNCONFIRMED → ASSIGNED
Ever confirmed: true
I cannot recreaet this problem that easy. I believe that we will assert there but not just open a Japanese file name. There are something related to HTML there.
move to M16
Target Milestone: --- → M16
reassign to travis , the webshell owner.
Assignee: ftang → travis
Status: ASSIGNED → NEW
GetLinkState now deals in terms of nsIURI objects and not strings anymore. This should therefore be fixed at this point.
Status: NEW → RESOLVED
Closed: 25 years ago
Resolution: --- → FIXED
Verified.
Status: RESOLVED → VERIFIED
You need to log in before you can comment on or make changes to this bug.