Closed
Bug 1167410
Opened 10 years ago
Closed 10 years ago
Value stored to 'eTLD' during its initialization is never read in nsEffectiveTLDService::GetBaseDomainInternal
Categories
(Core :: Networking: DNS, defect)
Core
Networking: DNS
Tracking
()
RESOLVED
FIXED
mozilla42
People
(Reporter: ritu, Assigned: ritu, Mentored)
References
(Blocks 1 open bug)
Details
(Keywords: clang-analyzer, Whiteboard: [lang=c++])
Attachments
(1 file, 3 obsolete files)
|
1.20 KB,
patch
|
u408661
:
review+
|
Details | Diff | Splinter Review |
+++ This bug was initially created as a clone of Bug #1144625 +++
Dead initialization. See fx-scan report at: https://people.mozilla.org/~sledru/reports/fx-scan-build/report-nsEffectiveTLDService.cpp-GetBaseDomainInternal-27-1.html#EndPath
Value stored to 'eTLD' during its initialization is never read in nsEffectiveTLDService::GetBaseDomainInternal. Line 254.
| Assignee | ||
Comment 1•10 years ago
|
||
Cloning the bug automatically added a depends on the original bug. Removing it as that's not needed.
No longer depends on: 1144625
Comment 3•10 years ago
|
||
Marco, sorry but Ritu has been working on it already.
| Assignee | ||
Comment 5•10 years ago
|
||
Submitting a patch for review.
Comment 6•10 years ago
|
||
Ritu, you should now look for a reviewer for your patch :)
Usually, I look at the hg history to find the owner of the code.
Flags: needinfo?(rkothari)
Updated•10 years ago
|
Assignee: nobody → rkothari
| Assignee | ||
Comment 7•10 years ago
|
||
Comment on attachment 8610715 [details] [diff] [review]
patch.diff
Requesting review on the patch I submitted. Thanks.
Attachment #8610715 -
Flags: review?(continuation)
Comment 8•10 years ago
|
||
Comment on attachment 8610715 [details] [diff] [review]
patch.diff
Review of attachment 8610715 [details] [diff] [review]:
-----------------------------------------------------------------
::: netwerk/dns/nsEffectiveTLDService.cpp
@@ +250,5 @@
> const char *prevDomain = nullptr;
> const char *currDomain = aHostname.get();
> const char *nextDot = strchr(currDomain, '.');
> const char *end = currDomain + aHostname.Length();
> + const char *eTLD; //Initialization was never used so commenting it out = currDomain;
This comment is a bit redundant. I'd just remove it entirely. (Just upload a new version of the patch when you have it and obsolete this version.)
It looks like I have done a number of reviews in this file, but they were actually just for wide-spread data structure changes. For this change, you should get a networking peer to review it ( https://wiki.mozilla.org/Modules/Core#Necko ). You could try Nick Hurley.
Attachment #8610715 -
Flags: review?(continuation)
| Assignee | ||
Updated•10 years ago
|
Flags: needinfo?(rkothari)
| Assignee | ||
Comment 9•10 years ago
|
||
Thanks Andrew! I will do that.
| Assignee | ||
Comment 10•10 years ago
|
||
Comment on attachment 8610715 [details] [diff] [review]
patch.diff
Will upload a new patch soon.
Attachment #8610715 -
Attachment is obsolete: true
Comment 12•10 years ago
|
||
That patch looks like a diff from the old patch, but you should upload a patch that is both of these combined, so that it is the diff from trunk.
Comment 13•10 years ago
|
||
Comment on attachment 8614909 [details] [diff] [review]
patchv2.diff
Review of attachment 8614909 [details] [diff] [review]:
-----------------------------------------------------------------
Like :mccr8 said, please upload a new patch that has the full change, from current in-tree version to your latest version.
Attachment #8614909 -
Flags: review?(hurley)
Comment 14•10 years ago
|
||
Also, looking at this, I'm not sure this is anything other than noise in the clang-analyzer output. The way the code is now, the default eTLD (currDomain) is relatively obvious, but changing the default to nullptr hides the default value way down in that not-quite-infinite loop. I'll have to think on it a bit more.
| Assignee | ||
Updated•10 years ago
|
Attachment #8614909 -
Attachment is obsolete: true
| Assignee | ||
Comment 16•10 years ago
|
||
Here's a link to a Try build that is underway to test this patch: https://treeherder.mozilla.org/#/jobs?repo=try&revision=34b9afbf6e1a
Comment 17•10 years ago
|
||
Comment on attachment 8616838 [details] [diff] [review]
patchv3.diff
Review of attachment 8616838 [details] [diff] [review]:
-----------------------------------------------------------------
::: netwerk/dns/nsEffectiveTLDService.cpp
@@ +250,5 @@
> const char *prevDomain = nullptr;
> const char *currDomain = aHostname.get();
> const char *nextDot = strchr(currDomain, '.');
> const char *end = currDomain + aHostname.Length();
> + const char *eTLD = nullptr;
Add a comment explaining that the default value is currDomain, as set in that while loop below, in order to make the code as readable as it is with this line that clang-analyzer complained about. Then we'll be good to go.
Attachment #8616838 -
Flags: review?(hurley)
| Assignee | ||
Comment 18•10 years ago
|
||
With the additional comment suggested by Nicholas.
Attachment #8616838 -
Attachment is obsolete: true
Attachment #8626772 -
Flags: review?(hurley)
Comment 19•10 years ago
|
||
Comment on attachment 8626772 [details] [diff] [review]
patchv3.diff
Review of attachment 8626772 [details] [diff] [review]:
-----------------------------------------------------------------
Looks good to me, thanks!
Attachment #8626772 -
Flags: review?(hurley) → review+
| Assignee | ||
Updated•10 years ago
|
Keywords: checkin-needed
Comment 20•10 years ago
|
||
Keywords: checkin-needed
Comment 21•10 years ago
|
||
Status: NEW → RESOLVED
Closed: 10 years ago
status-firefox42:
--- → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla42
You need to log in
before you can comment on or make changes to this bug.
Description
•