An easy way to cause an overflow is to pass in UINTMAX+1 to the smax argument on wmemcpy_s. You'll need to increase RSIZE_MEM_MAX first.