[Coverity] Uninitialized rowCount var in nsAutoCompleteController::RowIndexToSearch

RESOLVED FIXED

Status

()

Toolkit
Autocomplete
RESOLVED FIXED
13 years ago
6 years ago

People

(Reporter: brendan, Assigned: brendan)

Tracking

({coverity})

unspecified
coverity
Points:
---
Bug Flags:
in-testsuite -

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment)

fix
2.46 KB, patch
Brian Ryner (not reading)
: first-review+
dveditz
: second-review+
Details | Diff | Splinter Review
(Assignee)

Description

13 years ago
Coverity's SWAT static analyzer suite found this one.  It's obvious, and once
you initialize rowCount to 1, the whole if (searchResult == ...FAILURE) {...}
becomes dead code.  Patch next.

/be
(Assignee)

Comment 1

13 years ago
Created attachment 175572 [details] [diff] [review]
fix

Only issue is what hewitt might have had in mind with that GetErrorDescription
call.  Might have been late-night copy-paste programming -- elsewhere, when not
failing, the error string is returned as a result string from other methods,
e.g., nsAutoCompleteController::GetResultValueAt.

Fixed a few bogusly selective or "partial" else after returns too.

/be
Attachment #175572 - Flags: second-review?(dveditz)
Attachment #175572 - Flags: first-review?(bryner)
Comment on attachment 175572 [details] [diff] [review]
fix

r=dveditz
Attachment #175572 - Flags: second-review?(dveditz) → second-review+
Attachment #175572 - Flags: first-review?(bryner) → first-review+
(Assignee)

Comment 3

13 years ago
Fixed on trunk.  Nominate for 1.0.2 when you can.

/be
Status: NEW → RESOLVED
Last Resolved: 13 years ago
Resolution: --- → FIXED
Keywords: coverity

Updated

11 years ago
Flags: in-testsuite-
You need to log in before you can comment on or make changes to this bug.