Closed Bug 127490 Opened 23 years ago Closed 22 years ago

nsSchemaLoader::ProcessFacet may call SetFacetType on uninitialized PRUInt16

Categories

(Core :: XML, defect, P5)

defect

Tracking

()

VERIFIED FIXED
mozilla1.0

People

(Reporter: mozilla-bugs, Assigned: hjtoi-bugzilla)

References

()

Details

Attachments

(2 files, 1 obsolete file)

Compiler warning:

extensions/xmlextras/schema/src/nsSchemaLoader.cpp:2672
 `PRUint16 facetType' might be used uninitialized in this function

See
http://bonsai.mozilla.org/cvsblame.cgi?file=mozilla/extensions/xmlextras/schema/src/nsSchemaLoader.cpp&mark=2672,2709#2657

If nsSchemaLoader::ProcessFacet is passed an uncecognized aTagName, none of the
if branches will be taken and facetInst->SetFacetType will be passed an
uninitalized facetType.
Bug 59652 is the tracking bug for "xxx might be used uninitialized" warnings.

Blocks: 59652
*** Bug 131347 has been marked as a duplicate of this bug. ***
Attachment #74997 - Attachment is obsolete: true
Vidur, can you review?
Status: NEW → ASSIGNED
OS: Linux → All
Priority: -- → P5
Hardware: PC → All
Target Milestone: --- → mozilla1.0
Comment on attachment 74998 [details] [diff] [review]
Er, bail out if we can't handle it is better

sr=jband. returning an error seems correct. OK with me if reviewers like it.
Attachment #74998 - Flags: superreview+
Comment on attachment 74998 [details] [diff] [review]
Er, bail out if we can't handle it is better

r=vidur. Failure seems reasonable since we shouldn't expect to hit this case
(maybe return NS_ERROR_UNEXPECTED?).
Attachment #74998 - Flags: review+
Hmm, makes sense. Will return NS_ERROR_UNEXPECTED.
Comment on attachment 75478 [details] [diff] [review]
return unexpected

a=asa (on behalf of drivers) for checkin to the 1.0 trunk
Attachment #75478 - Flags: approval+
Checked in.
Status: ASSIGNED → RESOLVED
Closed: 22 years ago
Resolution: --- → FIXED
This warning no longer listed on TBox -
http://tinderbox.mozilla.org/SeaMonkey/warn1016784600.2968.html (Fri, 22 Mar
2002 03:10 EST), marking VERIFIED
Status: RESOLVED → VERIFIED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: