Handle null pointers in memcpy/memset