Closed
Bug 295927
Opened 19 years ago
Closed 2 months ago
Null pointer checks in RDF container code
Categories
(Core Graveyard :: RDF, defect)
Tracking
(Not tracked)
RESOLVED
INCOMPLETE
People
(Reporter: enndeakin, Unassigned)
Details
Attachments
(1 file)
1.65 KB,
patch
|
axel
:
review-
|
Details | Diff | Splinter Review |
datasource.GetTarget is supposed to return NS_RDF_NO_VALUE when a value isn't present. Some implementations of nsIRDFDataSource (like JS components such as the extension manager) just assume that returning null is ok, causing crashes in certain situations.
Reporter | ||
Comment 1•19 years ago
|
||
Attachment #184830 -
Flags: review?(axel)
Comment 2•19 years ago
|
||
Comment on attachment 184830 [details] [diff] [review] Add some null guards Grrr, returning null and success is verboten. Please file bugs on the implementations? Whatever, CompositeDataSourceImpl::GetSource has the same problem. Could you use the wallpaper of http://lxr.mozilla.org/seamonkey/source/rdf/base/src/nsCompositeDataSource.cpp# 245, with a NS_WARNING? Just accepting it is bad, IMHO.
Attachment #184830 -
Flags: review?(axel) → review-
Comment 3•19 years ago
|
||
Actually, you probably want to assert when people violate the api... And yes, file bugs on the api implementors.
Reporter | ||
Comment 4•19 years ago
|
||
Unfortunately, success return codes in JS are so inconsistently broken that fixing the implementors tends to make things worse. I'd file a bug, unless there is one, but coming up with a reliable testcase is hard.
Comment 5•19 years ago
|
||
I'd change the JS to return the right code, and then whenever we make XPConnect suck less it should work...
Reporter | ||
Comment 6•18 years ago
|
||
I wouldn't. I'd change the API such that returning null works. There are hundreds of consumers and extensions that assume that returning null indicates no value, and about 3, all in Mozilla code, that assume the success code is returned. Returning a success code is a non-sensical thing anyway.
Reporter | ||
Updated•9 years ago
|
Assignee: enndeakin → nobody
Updated•6 years ago
|
Product: Core → Core Graveyard
Status: NEW → RESOLVED
Closed: 2 months ago
Resolution: --- → INCOMPLETE
You need to log in
before you can comment on or make changes to this bug.
Description
•