Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Passwords LoginDatabase: Fix primary key returned from AddLogin
AddLogin calls `db_.GetLastInsertRowId()` to determine the primary key of the newly-added credential. However, in the "replace" code path, it called GetLastInsertRowId() twice, and the second time, it might return an incorrect result, since other DB insertions (insecure credentials and/or password notes) might have happened in the meantime. This CL fixes the issue by not calling GetLastInsertRowId() a second time, and instead reusing the value from the first call. (cherry picked from commit 1d969eb) Bug: 1352460 Change-Id: I50319678fa160959c9f766e71f3b53b0398c284a Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3841758 Reviewed-by: Mohamed Amir Yosef <mamir@chromium.org> Commit-Queue: Marc Treib <treib@chromium.org> Cr-Original-Commit-Position: refs/heads/main@{#1037059} Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3838572 Reviewed-by: Vasilii Sukhanov <vasilii@chromium.org> Auto-Submit: Marc Treib <treib@chromium.org> Cr-Commit-Position: refs/branch-heads/5249@{#36} Cr-Branched-From: 4f7bea5-refs/heads/main@{#1036826}
- Loading branch information