Search code examples
crashmemcpyfreeze

memcpy hangs when dest is NULL


I found a problem when memcpy's first argument is 0x0, the expected behaviour crash with SIGSEGV, but it didn't crash, it just hanged there, never return.What could be the reason?


Solution

  • According to cppreference behaviour is undefined:

    The behavior is undefined if either dest or src is a null pointer.