Remove vector preallocation in BookmarkNodeData::Element::ReadFromPickle
Preallocation in BookmarkNodeData::Element::ReadFromPickle can be abused by a pickle consisting of N nested children. If each child claims to contain M more children, the fast-fail logic (returns false when fewer than M children were provided) would never run until reading the last element at depth N. Along the way, we would have allocated N * M elements rather than N. Bug: 966282 Change-Id: I02de64d091091e5ab5b1628cabe9a5caea6fbe2c Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1628836Reviewed-by:Scott Violet <sky@chromium.org> Commit-Queue: Dan McArdle <dmcardle@chromium.org> Cr-Commit-Position: refs/heads/master@{#663988}
Showing
Please register or sign in to comment