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

while 语句不应被分号隔断

9.3.1 ID_while_semicolon
目录 › next › previous

while 语句不应被分号隔断。

示例:

while (condition);  // Non-compliant, see the semicolon
{
    ....
}

分号使循环失效,有造成死循环的危险。

参考

CWE-670 SEI CERT EXP15-C
Copyright©2024 360 Security Technology Inc., Licensed under the Apache-2.0 license.