空指针引用故障导致的软件安全问题不断出现,给各个方面带来了极大困扰和损失。文章研究利用静态测试的方法对一类空指针引用故障进行静态检测分析,同时提出一种利用判断逻辑信息进行空指针引用检测的方法。文章首先给出与基于判断逻辑的空指针引用故障相关的一些定义和故障分类。接着,提出使用函数摘要技术提取间接判空点和间接解引用点,定义该函数摘要为函数特征信息和后置约束信息的集合,研究了判断逻辑函数摘要生成和传递的方法。最后,利用有限状态机建立基于判断逻辑的空指针引用故障模型,给出故障模型描述,并利用状态机状态转换和函数摘要完成对此类空指针引用故障的检测。在静态检测工具DTS中实现了文中的方法并且对6个开源Java工程进行了测试,测试结果表明文中方法可以检测出更多的BUG并且同样适用于检测大型软件系统。
Software security problems caused by null pointer dereference continue to emerge and bring great distress and loss to all aspects. In this paper, we apply static testing method to analyze and detect a kind of null pointer dereference. This paper present a method to detect null pointer dereference using judgment logical information. First, give some definitions and fault classifications about based on logic judgment to detect null pointer dereference fault (BLJDNPDF). Then, using method summary technology to extract indirect null judgment point and indirect pointer dereference point, define method summary's contents, which contain method feature and post condition, do research on how to generate and transform method summary. Finally, using finite state machine to build model of BLJDNPDF, describe fault model description, and use state machine's state change and method summary to complete BLJDNPDF detection.