软件漏洞检测(Bug Finding):使用LLVM中的Clang Static Analyzer

LLVM这个名字最初的意思是底层虚拟机(Low Level Virtual Machine)的缩写,它是由UIUC开发的一个开源项目。现在LLVM的意义已经远远超越它最初的意思,所以现在LLVM就是整个项目的名称。

The LLVM Project is a collection of modular and reusable compiler and toolchain libraries / technologies.

LLVM is not a compiler! But, many compliers are built on LLVM such as Clang. 

本文中的实验环境选择使用Ubuntu系统,请确保你已经正确安装了LLVM及Clang。


一、CSA(Clang Static Analyzer)简介

The Clang Static Analyzer 【1】 is a source code analysis tool that finds bugs in C, C++, and Objective-C programs. CSA是Clang项目的一部分,而且完全开源。注意这里的静态分析,表示并不需要运行程序——CSA is built on Clang based on symbolic execution technique. It implements a collection of algorithms and techniques used to analyze source code in order to automatically find bugs. 

先来看一个最基本的例子,下面给出的代码中包含有三处明显的bug&

  • 9
    点赞
  • 15
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 1
    评论
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

白马负金羁

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值