Closed Bug 1651764 Opened 5 years ago Closed 5 years ago

Use of uninitialized variable in Database::EnsureBookmarkRoots()?

Categories

(Toolkit :: Places, defect)

defect

Tracking

()

RESOLVED FIXED
mozilla80
Tracking Status
firefox80 --- fixed

People

(Reporter: izbyshev, Assigned: izbyshev)

References

(Blocks 1 open bug)

Details

Attachments

(1 file)

If https://searchfox.org/mozilla-central/rev/8d55e188/toolkit/components/places/Database.cpp#1449 is reachable without visiting any of the prior if statements, it reads uninitialized rv. In any case, this check is useless (rv is checked after each assignment in the prior ifs).

Yes, that line is wrong - it shouldn't & doesn't need to be there. Alexey, do you want to make a patch to remove that one line?

Status: UNCONFIRMED → NEW
Ever confirmed: true
Flags: needinfo?(izbyshev)

I don't mind making a patch, but that would be my first patch here, so I don't have any setup apart from a build environment for Firefox that I needed to run Svace on it. Should I follow this guide (including creation of Phabricator account, etc.), or are there any shortcuts for trivial patches?

(In reply to Alexey Izbyshev from comment #2)

I don't mind making a patch, but that would be my first patch here, so I don't have any setup apart from a build environment for Firefox that I needed to run Svace on it. Should I follow this guide (including creation of Phabricator account, etc.), or are there any shortcuts for trivial patches?

We're easy either way, I'm quite happy to mentor this bug. This is probably the more up to date guide to look at: https://firefox-source-docs.mozilla.org/contributing/contribution_quickref.html

Apart from being unneeded, this check reads uninitialized 'rv' in case
no prior 'if' statement is visited.

Assignee: nobody → izbyshev
Status: NEW → ASSIGNED

(In reply to Mark Banner (:standard8) from comment #3)

We're easy either way, I'm quite happy to mentor this bug. This is probably the more up to date guide to look at: https://firefox-source-docs.mozilla.org/contributing/contribution_quickref.html

Thanks for the link! I've submitted the patch (with you as the requested reviewer). I've run ./mach build locally, but haven't run any tests.

Status: ASSIGNED → NEW
Flags: needinfo?(izbyshev)

Thank you for the patch, I've just triggered it to land - it will land on our integration branch first and then will be merged to the main branch within about 24 hours. There will be comments here when that happens.

Pushed by mbanner@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/92e126b6a9b7 Remove unneeded 'rv' check in Database::EnsureBookmarkRoots. r=Standard8
Status: NEW → RESOLVED
Closed: 5 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla80
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: