Closed Bug 290180 Opened 15 years ago Closed 15 years ago

Coverity errors found in toolkit/

Categories

(Toolkit Graveyard :: Build Config, defect)

defect
Not set

Tracking

(Not tracked)

RESOLVED FIXED
mozilla1.8beta2

People

(Reporter: benjamin, Assigned: benjamin)

References

(Blocks 1 open bug)

Details

(Keywords: coverity)

Attachments

(1 file)

Minor cleanup from errors found by Coverity static-analysis tool in the
toolkit/* directory.
These are mainly edge-case OOM errors, but the GetScreenOrigin function is
broken by design and may well be the source of memory leaks, and might actually
be worth taking on the 1.0.x branch... let me know what you think about that.
Attachment #180589 - Flags: first-review?(darin)
Comment on attachment 180589 [details] [diff] [review]
Coverity-detected errors in toolkit/*, rev. 1

>Index: toolkit/components/history/src/nsGlobalHistory.cpp

>+      if (tokenStruct)
>+        aResult.AppendElement((void *)tokenStruct);
>+
>       // reset our state
>       tokenName = tokenValue = nsnull;
>       tokenNameLength = tokenValueLength = 0;


>Index: toolkit/components/passwordmgr/base/nsPasswordManager.cpp

>+          PRUnichar* data = ToNewUnicode(userValue);
>+          if (data)
>+            result->mArray.AppendElement(data);
>         }


These changes are fine, but maybe it would be better to early
return with some error to indicate out of memory?  Or, if that
is just far from convenient, then no problem.


r=darin
Attachment #180589 - Flags: first-review?(darin) → first-review+
Comment on attachment 180589 [details] [diff] [review]
Coverity-detected errors in toolkit/*, rev. 1

Yeah, there isn't a good way to report errors that does not skip other logic.
Swallowing them looked like the better choice.
Attachment #180589 - Flags: approval1.8b2?
Comment on attachment 180589 [details] [diff] [review]
Coverity-detected errors in toolkit/*, rev. 1

a=asa
Attachment #180589 - Flags: approval1.8b2? → approval1.8b2+
Fixed on trunk.
Status: NEW → RESOLVED
Closed: 15 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla1.8beta2
Product: Toolkit → Toolkit Graveyard
You need to log in before you can comment on or make changes to this bug.