Bug 246267

Summary: [WTF] ASSERT on source pointer before calling memcpy()
Product: WebKit Reporter: Philippe Normand <philn>
Component: Web Template FrameworkAssignee: Philippe Normand <philn>
Status: RESOLVED DUPLICATE    
Severity: Normal CC: darin
Priority: P2    
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   

Description Philippe Normand 2022-10-10 01:03:40 PDT
As noted in https://bugs.webkit.org/show_bug.cgi?id=245640 in at least one case memcpy() was being called with a null source pointer in StringImpl::copyCharacters(). We should add an ASSERT there.
Comment 1 Philippe Normand 2022-10-10 01:06:14 PDT
Pull request: https://github.com/WebKit/WebKit/pull/5180
Comment 2 Philippe Normand 2022-10-10 02:19:34 PDT

*** This bug has been marked as a duplicate of bug 246260 ***
Comment 3 Darin Adler 2022-10-10 09:15:36 PDT
Turns out *many* callers are passing nullptr for destination pointer as well as source pointer, so the use of memcpy there is incorrect. I ended up working on a much bigger patch for this, but in the end we might want to land something smaller than what I did.