Closed Bug 121833 Opened 24 years ago Closed 24 years ago

ASSERTION: |First()| on an empty string: 'Length()>0'

Categories

(Core Graveyard :: RDF, defect, P3)

x86
FreeBSD
defect

Tracking

(Not tracked)

RESOLVED FIXED
mozilla0.9.9

People

(Reporter: timeless, Assigned: waterson)

References

()

Details

(Keywords: assertion)

Attachments

(1 file, 3 obsolete files)

#3 0x282fb76c in nsAString::First (this=0xbfbfa428) at /home/timeless/mozilla/string/src/nsAString.cpp:140 #4 0x28d1a969 in rdf_MakeRelativeRef (aBaseURI=@0xbfbfa394, aURI=@0xbfbfa428) at /home/timeless/mozilla/rdf/base/src/rdfutil.cpp:84 #5 0x28d17af9 in nsRDFXMLSerializer::SerializeDescription (this=0x8bcd0c0, aStream=0x8b89604, aResource=0x8bf7360) at /home/timeless/mozilla/rdf/base/src/nsRDFXMLSerializer.cpp:535 #6 0x28d1a7ca in nsRDFXMLSerializer::Serialize (this=0x8bcd0c0, aStream=0x8b89604) at /home/timeless/mozilla/rdf/base/src/nsRDFXMLSerializer.cpp:1040 #7 0x28d13db6 in RDFXMLDataSourceImpl::Serialize (this=0x8b9c300, aStream=0x8b89604) at /home/timeless/mozilla/rdf/base/src/nsRDFXMLDataSource.cpp:1096 #8 0x28d130b9 in RDFXMLDataSourceImpl::Flush (this=0x8b9c300) at /home/timeless/mozilla/rdf/base/src/nsRDFXMLDataSource.cpp:831 #9 0x282ea9b8 in XPTC_InvokeByIndex (that=0x8b9c304, methodIndex=6, paramCount=0, params=0xbfbfaabc) at /home/timeless/mozilla/xpcom/reflect/xptcall/src/md/unix/xptcinvoke_unixish_x86.cpp:153
Attached patch try to be nice (obsolete) — Splinter Review
Attached patch wouldn't this be simpler? (obsolete) — Splinter Review
Don't we just need to check if aURI IsEmpty?
Status: NEW → ASSIGNED
Keywords: review
Priority: -- → P3
Target Milestone: --- → mozilla0.9.9
Comment on attachment 66459 [details] [diff] [review] wouldn't this be simpler? r=tingley. rdf_MakeRelativeName looks like it could have the same issue, but I'm not sure it would ever actually arise. (Actually, I'm not sure the function is ever called.) A couple other spots with this pattern too (one in nsRDFXMLSerializer.cpp that should be fine, and one in nsRDFParserUtils::StripAndConvert that looks like it might be possible to trigger).
Attachment #66459 - Flags: review+
Attached patch remove unused function, too (obsolete) — Splinter Review
Sho'nuff. rdf_MakeRelativeName is unused. Removed it. I think the usage of `First' in nsRDFXMLSerializer.cpp should be fine, and the use in nsRDFParserUtils.cpp is already protected by an IsEmpty check.
Attachment #66459 - Attachment is obsolete: true
Comment on attachment 66470 [details] [diff] [review] remove unused function, too sr=shaver.
Attachment #66470 - Flags: superreview+
Attached patch one more timeSplinter Review
I found timeless on IRC and it turns out he was trying to optimize this code, as well. The string-fu here is archaic: this last patch cleans up timeless's optimization, and uses Substring rather than Find.
Attachment #66456 - Attachment is obsolete: true
Attachment #66470 - Attachment is obsolete: true
Comment on attachment 66485 [details] [diff] [review] one more time i like it.
Attachment #66485 - Flags: review+
Comment on attachment 66485 [details] [diff] [review] one more time Yeah, sure, whatever. sr=shaver.
Attachment #66485 - Flags: review+ → superreview+
Comment on attachment 66485 [details] [diff] [review] one more time r=timeless [patch manager collision]
Attachment #66485 - Flags: review+
Fixed. Thanks!
Status: ASSIGNED → RESOLVED
Closed: 24 years ago
Resolution: --- → FIXED
Keywords: assertion
QA Contact: tever → nobody
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: