1 Star 0 Fork 0

Eternal/how2heap

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
tcache_dup.c 500 Bytes
一键复制 编辑 原始数据 按行查看 历史
#include <stdio.h>
#include <stdlib.h>
#include <assert.h>
int main()
{
printf("This file demonstrates a simple double-free attack with tcache.\n");
printf("Allocating buffer.\n");
int *a = malloc(8);
printf("malloc(8): %p\n", a);
printf("Freeing twice...\n");
free(a);
free(a);
printf("Now the free list has [ %p, %p ].\n", a, a);
void *b = malloc(8);
void *c = malloc(8);
printf("Next allocated buffers will be same: [ %p, %p ].\n", b, c);
assert((long)b == (long)c);
return 0;
}
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/tordan/how2heap.git
git@gitee.com:tordan/how2heap.git
tordan
how2heap
how2heap
master

搜索帮助