Closed Bug 835 Opened 26 years ago Closed 26 years ago

META description causes assertion failure in the RDF module

Categories

(MozillaClassic Graveyard :: Aurora/RDF BE, defect, P2)

x86
Windows NT
defect

Tracking

(Not tracked)

VERIFIED FIXED

People

(Reporter: bratell, Assigned: ftang)

References

()

Details

When trying to browse some pages I got a lot of assertion failures in the rdf modules so I stripped the source code of those pages as much as possible and found that the tag: <meta name="description" content="Foo"> caused it but only when visiting certain domains. For instance, you get the failures at http://c245.ryd.student.liu.se/mozillabug1.html and at http://www.student.liu.se/ but not at http://www.lysator.liu.se/~bratell/ which has a copy of the page at c245.ryd.student.liu.se. What I get is assertion failures at /mozilla/modules/rdf/src/mcf.c line 321, /mozilla/modules/rdf/src/nlcstore.c line 328 or assertion failures at /mozilla/modules/rdf/src/nlcstore.c line 371, /mozilla/modules/rdf/src/mcf.c line 631 I didn't manage to get a stack trace since I was using a nightly build (19980917), but maybe you can reproduce it yourself. Since this might be caused by some I18n stuff, I should tell you that I have a Swedish system (character set latin-1)
Assignee: guha → rjc
Assignee: rjc → ftang
Frank, please take a look at this, its almost certainly a UTF8 issue.
Status: NEW → ASSIGNED
The problem is in ht.c HT_LayoutComplete routine. That routine have several problem. First of all, it does not convert content into UTF8 from the win_csid before it passed to RDF_Assert. Second, it call the PA_FetchParamValue with a BAD CAST. The second parameter should be a win_csid, which should be get back from a INTL_CharSetInfo object. The INTL_CharSetInfo object it self is not a csid. So... the program should do... INTL_CharSetInfo intl_csi; /* don't named it csid to confuse yourself */ .... intl_csi = LO_GetDocumentCharacterSetInfo(context); int16 wincsid = INTL_GetCSIWinCSID(intl_csi); .... name = PA_FetchParamValue(metaList, "name", wincsid); content = PA_FetchParamValue(metaList, "content", wincsid); ... then you need to convert content into UTF8 by calling char* contentInUTF8 = INTL_ConvertLineWithoutAutoDetect(wincsid, CS_UTF8, content, XP_STRLEN(content); You may need to do XP_FREE contentInUTF8 if you no longer need it. Cast a INTL_CharSetInfo object into uint16 and pass it into PA_FetchParamValue is a very bad practice of programming. (I don't know who origionally write the code like that. )
Make it clear: <meta name="description" content="Foo"> won't cause assert. <meta name="description" content="someLatinAccentCharacter"> will.....
Bugzilla bug 835 OK, the fix have been push to http://peoplestage.netscape.com/ftang/patches/ht.c.diff.txt and it should be accessabled from outside as http://people.netscape.com/ftang/patches/ht.c.diff.txt when it got push. rjc, could you grant me check in right ? Thanks.
Status: ASSIGNED → RESOLVED
Closed: 26 years ago
Resolution: --- → FIXED
the fix get check in into modules/rdf/src/ht.c rev 3.75
QA Contact: 3849
Old code base, ftang is this still valid? Set beppe@netscape.com for qa contact
Status: RESOLVED → VERIFIED
above URL is not a valid path, presuming fix is good.
You need to log in before you can comment on or make changes to this bug.