Closed Bug 1242924 Opened 4 years ago Closed 4 years ago

[Static Analysis][Unchecked return value] In function DOMStorageManager::Observe from DOMStorageManager.cpp

Categories

(Core :: DOM: Core & HTML, defect)

defect
Not set

Tracking

()

RESOLVED FIXED
mozilla47
Tracking Status
firefox47 --- fixed

People

(Reporter: andi, Assigned: andi)

References

(Blocks 1 open bug)

Details

(Keywords: coverity, Whiteboard: CID 1349783 )

Attachments

(1 file)

The Static Analysis tool Coverity added that the return value of  pattern.Init is not checked even though object is used later on. An incomplete initialization can lead to unexpected behavior later on when it's used, for example:

>>  // Clear everything, caches + database
>>  if (!strcmp(aTopic, "cookie-cleared")) {
>>    ClearCaches(DOMStorageCache::kUnloadComplete, pattern, EmptyCString());
>>    return NS_OK;
>>  }
Comment on attachment 8712123 [details]
MozReview Request: Bug 1242924 - check return of  pattern.Init in DOMStorageManager::Observe. r?jst

https://reviewboard.mozilla.org/r/32433/#review31685
Attachment #8712123 - Flags: review?(jst) → review+
https://hg.mozilla.org/mozilla-central/rev/b29b876744e3
Status: NEW → RESOLVED
Closed: 4 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla47
Component: DOM → DOM: Core & HTML
You need to log in before you can comment on or make changes to this bug.