Closed
Bug 1171016
Opened 10 years ago
Closed 10 years ago
ParseFTPList.cpp: Value stored to 'linelen' is never read
Categories
(Core Graveyard :: Networking: FTP, defect)
Tracking
(firefox41 fixed)
RESOLVED
FIXED
mozilla41
Tracking | Status | |
---|---|---|
firefox41 | --- | fixed |
People
(Reporter: Sylvestre, Assigned: sanchitkum, Mentored)
Details
(Keywords: clang-analyzer, Whiteboard: [good first bug][lang=C++])
Attachments
(1 file, 1 obsolete file)
1.51 KB,
patch
|
mcmanus
:
review+
|
Details | Diff | Splinter Review |
Comment 1•10 years ago
|
||
I'd like to work in this.
It looks like it has been put there as a variable initialization, which happens anyway at https://dxr.mozilla.org/mozilla-central/source/netwerk/streamconv/converters/ParseFTPList.cpp?from=ParseFTPList.cpp#50
Should we romove it?
Reporter | ||
Comment 2•10 years ago
|
||
yes (as the title of this bug suggests ;)
Assignee | ||
Comment 3•10 years ago
|
||
If no one is working on it. Should i go ahead and submit a patch? :)
Flags: needinfo?(sledru)
Reporter | ||
Comment 4•10 years ago
|
||
Piervincenzo seems to work on this. If he/she didn't proposed a patch in a few days, you are welcome to take it.
Flags: needinfo?(sledru)
Assignee | ||
Comment 5•10 years ago
|
||
Okay. :)
Assignee | ||
Comment 6•10 years ago
|
||
Initialized the variable 'linelen' at its declaration.
Attachment #8617868 -
Flags: review?(sledru)
Reporter | ||
Comment 7•10 years ago
|
||
Comment on attachment 8617868 [details] [diff] [review]
bug1171016_initializationAtDeclaration.diff
lgtm but I am not the owner of this code.
Attachment #8617868 -
Flags: review?(sledru)
Reporter | ||
Updated•10 years ago
|
Assignee: nobody → sanchitkum
Assignee | ||
Comment 8•10 years ago
|
||
Okay.
Assignee | ||
Updated•10 years ago
|
Attachment #8617868 -
Flags: review?(mcmanus)
Comment 9•10 years ago
|
||
Comment on attachment 8617868 [details] [diff] [review]
bug1171016_initializationAtDeclaration.diff
Review of attachment 8617868 [details] [diff] [review]:
-----------------------------------------------------------------
thanks!
::: netwerk/streamconv/converters/ParseFTPList.cpp
@@ -23,5 @@
> int ParseFTPList(const char *line, struct list_state *state,
> struct list_result *result )
> {
> unsigned int carry_buf_len; /* copy of state->carry_buf_len */
> - unsigned int linelen, pos;
I would rather fix this by declaring the variable where it is first meaningfully used.
remove lineline from this declaration
@@ -36,5 @@
> /* carry buffer is only valid from one line to the next */
> carry_buf_len = state->carry_buf_len;
> state->carry_buf_len = 0;
>
> - linelen = 0;
remove this too (as you did)
and then down below where we have "linelen = p - line;" just change that to also be the declaration: "unsigned int linelen = p - line;"
Attachment #8617868 -
Flags: review?(mcmanus) → review-
Assignee | ||
Comment 10•10 years ago
|
||
Okay. I will fix that now.
Thanks.
Assignee | ||
Comment 11•10 years ago
|
||
Changes made to declare the variable 'linelen' where it is being used.
Attachment #8617868 -
Attachment is obsolete: true
Attachment #8621141 -
Flags: review?(mcmanus)
Updated•10 years ago
|
Attachment #8621141 -
Flags: review?(mcmanus) → review+
Comment 12•10 years ago
|
||
thanks sanchit
Assignee | ||
Updated•10 years ago
|
Keywords: checkin-needed
Comment 13•10 years ago
|
||
Keywords: checkin-needed
Comment 14•10 years ago
|
||
Status: NEW → RESOLVED
Closed: 10 years ago
status-firefox41:
--- → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla41
Updated•1 year ago
|
Product: Core → Core Graveyard
You need to log in
before you can comment on or make changes to this bug.
Description
•