commit | c2de834c1d71955c14e9a13128cfa93675c2fd62 | [log] [tgz] |
---|---|---|
author | Leonard Grey <lgrey@chromium.org> | Wed Apr 24 19:57:43 2019 |
committer | Commit Bot <commit-bot@chromium.org> | Wed Apr 24 19:57:43 2019 |
tree | 67664017f00256c56068cc9ddfb1685c43bba674 | |
parent | 950e42b1220cc1a9f64c591843222e0623c0df48 [diff] |
UIDevTools: Prevent overflow when setting views properties When setting a "CSS" property to the empty string in DevTools (easily done by accident), CSSAgent is called twice: (assume the property is "Enabled) First, with "\n Enabled:\n", and then, with " \n " or similar. The loop in the parsing code's exit condition is "size of parsed tokens - 1" The good news is that this means that the first call never enters the loop. The same is true for any odd number of tokens, so I removed the DCHECK. The bad news is that the size is unsigned, so when no tokens are parsed, it wraps around and we crash trying to read the first token. Bug: 954675 Change-Id: I31735f0344246458c3f33bf0cac3ed2eb3758ce6 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1582759 Reviewed-by: Wei Li <weili@chromium.org> Commit-Queue: Leonard Grey <lgrey@chromium.org> Cr-Commit-Position: refs/heads/master@{#653715}
Chromium is an open-source browser project that aims to build a safer, faster, and more stable way for all users to experience the web.
The project's web site is https://www.chromium.org.
Documentation in the source is rooted in docs/README.md.
Learn how to Get Around the Chromium Source Code Directory Structure .