Make DropTargetEvent copyable.
This is necessary for creating modified DropTargetEvents (e.g. if you need to make a provided const event& relative to a new parent). The primary concern here is |data_|, which is a reference member. Copying a DropTargetEvent shallow-copies this reference rather than deep-copying it, so the lifetime of the copied event must not extend past that of the data that was used to construct the original event. I'm concerned that this change makes it easier for people to cause UAFs; however, that concern already existed with the original object, and the right fix is probably not to prevent copying but to make DropTargetEvent not keep |data_| by reference to begin with. That's a more involved change than I have the scope to do for now. Bug: 923188 Change-Id: I35d475081584577cc0217f672a45b5a9e5a60a4e Reviewed-on: https://chromium-review.googlesource.com/c/1483673 Auto-Submit: Peter Kasting <pkasting@chromium.org> Commit-Queue: Scott Violet <sky@chromium.org> Reviewed-by:Scott Violet <sky@chromium.org> Cr-Commit-Position: refs/heads/master@{#634864}
Showing
Please register or sign in to comment