Bug 246260
| Summary: | StringImpl::copyCharacters incorrectly uses memcpy on destination pointers that may be null | ||
|---|---|---|---|
| Product: | WebKit | Reporter: | Darin Adler <darin> |
| Component: | Web Template Framework | Assignee: | Darin Adler <darin> |
| Status: | RESOLVED FIXED | ||
| Severity: | Normal | CC: | philn, webkit-bug-importer |
| Priority: | P2 | Keywords: | InRadar |
| Version: | WebKit Nightly Build | ||
| Hardware: | Unspecified | ||
| OS: | Unspecified | ||
Darin Adler
After studying the call sites of StringImpl::copyCharacters, it is clear that many rely on being able to pass a combination of a null pointer for the destination and a zero length. The documentation of std::memcpy makes it clear that this leads to undefined behavior, so we can’t do this any more.
| Attachments | ||
|---|---|---|
| Add attachment proposed patch, testcase, etc. |
Radar WebKit Bug Importer
<rdar://problem/100962334>
Darin Adler
Pull request: https://github.com/WebKit/WebKit/pull/5184
Philippe Normand
*** Bug 246267 has been marked as a duplicate of this bug. ***
EWS
Committed 255600@main (71265755b78a): <https://commits.webkit.org/255600@main>
Reviewed commits have been landed. Closing PR #5184 and removing active labels.