Bug 263615
| Summary: | The URL move constructor doesn't invalidate the "moved-out" URL | ||
|---|---|---|---|
| Product: | WebKit | Reporter: | Chris Dumez <cdumez> |
| Component: | Web Template Framework | Assignee: | Chris Dumez <cdumez> |
| Status: | RESOLVED FIXED | ||
| Severity: | Normal | CC: | webkit-bug-importer |
| Priority: | P2 | Keywords: | InRadar |
| Version: | WebKit Nightly Build | ||
| Hardware: | Unspecified | ||
| OS: | Unspecified | ||
| See Also: | https://bugs.webkit.org/show_bug.cgi?id=263574 | ||
Chris Dumez
The URL move constructor doesn't invalidate the "moved-out" URL. This can lead WebKit code to do weird things.
For example, URLKeepingBlobAlive contains a m_url data member and is often moved-out to pass to a lambda. The destructor of the "moved-out" URLKeepingBlobAlive then runs and calls `unregisterBlobURLHandleIfNecessary()`. `unregisterBlobURLHandleIfNecessary()` will try to use m_url after it's been moved out to see if the URL protocol is "blob". This causes URL::protocolIs() to try to do out-of-bound access in the underlying String (since the URL is marked as valid, even though it's m_string was moved out and other data members that are indexes into that string were not reset). Luckily, String's operator[] just returns nil when doing an out of bounds access at the moment.
| Attachments | ||
|---|---|---|
| Add attachment proposed patch, testcase, etc. |
Chris Dumez
Pull request: https://github.com/WebKit/WebKit/pull/19512
EWS
Committed 269750@main (e68882fc2467): <https://commits.webkit.org/269750@main>
Reviewed commits have been landed. Closing PR #19512 and removing active labels.
Radar WebKit Bug Importer
<rdar://problem/117454783>