我在我的应用程序中使用 memcpy。memcpy 随机崩溃,下面是我在 Dr.Watson 文件中获得的日志。
100181b5 8bd1 mov edx,ecx
100181b7 c1e902 shr ecx,0x2
100181ba 8d7c030c lea edi,[ebx+eax+0xc]
100181be f3a5 rep movsd
100181c0 8bca mov ecx,edx
100181c2 83e103 and ecx,0x3
FAULT ->100181c5 f3a4 rep movsb ds:02a3b000=?? es:01b14e64=00
100181c7 ff1508450210 call dword ptr [Debug (10024508)]
100181cd 83c424 add esp,0x24
100181d0 6854580210 push 0x10025854
100181d5 ff1508450210 call dword ptr [Debug (10024508)]
100181db 83c404 add esp,0x4
下面是代码
memcpy((char *)dep + (int)sizeof(EntryRec) + (int)adp->fileHdr.keySize, data, dataSize );
在哪里:
- dep 是一个结构
- EntryRec 是一个字符指针
- adp是一个结构
- 数据不在
NULL
这种情况下
有没有人遇到过这个问题并且可以帮助我?
我试图调试 prog,然后我收到以下错误 Prog.exe(MSVCRTD.DLL) 中的未处理异常:0xC0000005: Access voilation
数据被传递给这个程序的参数,这是无效的*
更多信息:
我试图调试代码适配器在以下区域崩溃此函数存在于 OUTPUT.c 中(我认为这是一个库函数)
#else /* _UNICODE */
if (flags & (FL_LONG|FL_WIDECHAR)) {
if (text.wz == NULL) /* NULL passed, use special string */
text.wz = __wnullstring;
bufferiswide = 1;
pwch = text.wz;
while ( i-- && *pwch )
++pwch;
textlen = pwch - text.wz;
/* textlen now contains length in wide chars */
} else {
if (text.sz == NULL) /* NULL passed, use special string */
text.sz = __nullstring;
p = text.sz;
while (i-- && *p) //Crash points here
++p;
textlen = p - text.sz; /* length of the string */
}
变量值:p=“”(未初始化)i=2147483598