☰
  • 首页
  • 规则分类
  • 项目介绍
search
•••

try 关键字的作用域不应为空

9.6.1 ID_try_emptyBlock
目录 › next › previous

try 关键字的作用域,即 try 关键字后的复合语句不应为空,否则无实际意义,往往是残留代码或功能未实现。

示例:

try   // Non-compliant, the compound-statement is empty
{}
catch (Exception& e)
{
    handle(e);  // The whole statement is meaningless
}

参考

CWE-1071
Copyright©2024 360 Security Technology Inc., Licensed under the Apache-2.0 license.