gdb或者vlagrind报告:

==14569== Jump to the invalid address stated on the next line
==14569==    at 0x0: ???
==14569==  Address 0x0 is not stack'd, malloc'd or (recently) free'd

 错误原因:函数通过jmp,call,ret等指令跳转到0x00,错误可能出现的范围

1.函数缓冲区溢出覆盖了返回地址,然后又调用了return,例如

#include <memory.h>

void main(void)
{
	int i;
	memset(&i,0,20);
	return;
}

 2.函数使用了未初始化的函数指针,例如

void (*func)(void);

void main(void)
{
	func();
}

 

 posted on 2015-09-08 11:44  莫扎特的代码  阅读(902)  评论(0编辑  收藏  举报