Bitmask calculation in AutofillProfile::SetValidityFromBitfieldValue is suspicious |
||
Issue description// Compute the bitmask based on the number a bits per type. For example, this // could be the two least significant bits (0b11). const int kBitmask = 2 ^ validity_bits_per_type - 1; This is doing a xor. I'm guessing this should be (2 << validity_bits_per_type) - 1 (and of course, validity_bits_per_type can never be the size of the type in bits either, since the left shift will overflow).
,
Sep 13 2017
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/2f8d30f216e14e40ccce6c9e73fff47f5c0ae255 commit 2f8d30f216e14e40ccce6c9e73fff47f5c0ae255 Author: sebsg <sebsg@chromium.org> Date: Wed Sep 13 21:25:53 2017 [Autofill] Use bitshift when computing validity bitmask. Bug: 764853 Change-Id: I6d115095dca728441100f6255a18bbc83a375502 Reviewed-on: https://chromium-review.googlesource.com/665385 Reviewed-by: Daniel Cheng <dcheng@chromium.org> Commit-Queue: Sebastien Seguin-Gagnon <sebsg@chromium.org> Cr-Commit-Position: refs/heads/master@{#501753} [modify] https://crrev.com/2f8d30f216e14e40ccce6c9e73fff47f5c0ae255/components/autofill/core/browser/autofill_profile.cc
,
Sep 13 2017
|
||
►
Sign in to add a comment |
||
Comment 1 by se...@chromium.org
, Sep 13 2017