Open Bug 620950 Opened 9 years ago Updated Last year

nsImageMap::AddArea could set area to 0 in default NS_NOTREACHED case

Categories

(Core :: Layout: Images, Video, and HTML Frames, enhancement)

enhancement
Not set

Tracking

()

ASSIGNED

People

(Reporter: timeless, Assigned: timeless)

References

(Blocks 1 open bug)

Details

(Keywords: coverity)

Attachments

(1 file)

833 nsImageMap::AddArea(nsIContent* aArea)
834 {
842   Area* area;
843   switch (aArea->FindAttrValueIn(kNameSpaceID_None, nsGkAtoms::shape,
844                                  strings, eIgnoreCase)) {
862   default:
863     NS_NOTREACHED("FindAttrValueIn returned an unexpected value.");
864     break;
865   }
866   if (!area)
867     return NS_ERROR_OUT_OF_MEMORY;
868 
869   //Add focus listener to track area focus changes
870   aArea->AddEventListenerByIID(this, NS_GET_IID(nsIDOMFocusListener));
881   area->ParseCoords(coords);
882   mAreas.AppendElement(area);
Attached patch proposalSplinter Review
NS_NOTREACHED doesn't do anything in opt builds. the other approach would be NS_RUNTIMEABORT, I don't have an opinion.
Assignee: nobody → timeless
Status: NEW → ASSIGNED
Attachment #499382 - Flags: review?(jst)
Comment on attachment 499382 [details] [diff] [review]
proposal

Clearing out old reviews. If this is still relevant, please re-request review for this patch.
Attachment #499382 - Flags: review?(jst)
Product: Core → Core Graveyard
Product: Core Graveyard → Core
You need to log in before you can comment on or make changes to this bug.