Last Comment Bug 712510 - Clang Static Analysis: Garbage return value in content/html/content/src/nsTextEditorState.cpp
: Clang Static Analysis: Garbage return value in content/html/content/src/nsTex...
Status: RESOLVED FIXED
:
Product: Core
Classification: Components
Component: Editor (show other bugs)
: Trunk
: All All
: -- normal (vote)
: mozilla12
Assigned To: :Ehsan Akhgari
:
:
Mentors:
http://people.mozilla.org/~gszorc/cla...
Depends on:
Blocks: clang-analysis
  Show dependency treegraph
 
Reported: 2011-12-20 17:04 PST by Christian Holler (:decoder)
Modified: 2012-01-04 04:49 PST (History)
3 users (show)
See Also:
Crash Signature:
(edit)
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---


Attachments
Patch (v1) (1.12 KB, patch)
2012-01-03 14:58 PST, :Ehsan Akhgari
roc: review+
Details | Diff | Splinter Review

Description Christian Holler (:decoder) 2011-12-20 17:04:59 PST
The following report (in the URL field) has been generated by static analysis using Clang.

It would be good if someone familiar with the particular code could check if

- this is really a bug or a false positive
- and/or if it makes sense to adjust the code (even if there is not a real bug present, e.g. by adding a missing initialization).


In this particular report, the problem seems to be that the | nsresult rv; | variable declared in line 1173 could be returned uninitialized (there exists at least one path through the code). It would probably be good to initialize this variable to a sane default value to be sure.

Not sure which category this belongs to, please move to the right place if you know where this should go :)
Comment 1 :Ehsan Akhgari 2012-01-03 14:58:26 PST
I don't see this happening in practice but let's just shut the warning up.  :-)
Comment 2 :Ehsan Akhgari 2012-01-03 14:58:52 PST
Created attachment 585567 [details] [diff] [review]
Patch (v1)
Comment 4 Marco Bonardo [::mak] 2012-01-04 04:49:39 PST
https://hg.mozilla.org/mozilla-central/rev/6840cbb0b4cf

Note You need to log in before you can comment on or make changes to this bug.