代码审计漏洞主要容易出现的接口和输入输出位置
c language code review note
1 command: argc argv
environmental var: getenv
2
input/output:read() fscanf() getc() fgetc() fgets() vfscanf()
keyboard input: read() scanf() getchar() gets()
network data: read(),recv(),recvfrom()
3 string function
strcpy(),strcat
4 poniter/array outbound
5 check all function return value //
malloc() calloc() realloc() new()
6 check all the data lengh of the user
7 check all the data format
注:
1 检查指针是否为空
2 检查字符串是否正常结束。
3 检查数组大小,内存空间,越界等行为。
4 文件的读取写入数据格式,大小,缓存。
5 关键系统命令函数指令解析。