首页 > 解决方案 > 强化工具缓冲区溢出

问题描述

char tmp[] = "hello world";
char *line;
size_t sz;

sz = strlen(tmp) +1;
line = (char*)malloc(sz);

if (line)
    memset(line, 0x00, sz);

使用名为 Fortify 的工具,它将 memset 标记为缓冲区溢出。有谁知道为什么?

标签: cbuffer-overflowsecure-coding

解决方案


推荐阅读