CodeQL之CWE-252
CWE-252: Unchecked Return Value
The software does not check the return value from a method or function, which can prevent it from detecting unexpected states and conditions.
顾名思义,Unchecked Return Value
,就是在实际代码中缺少了对返回值的检查,在实际代码中,对错误返回值的检查尤为重要,因为需要进入到相应的错误处理环节中去,否则会影响程序的正常运行。比如我们常见的对malloc
返回值的检查等等,和CWE-252
相关的还有CWE-754
、CWE-273
、CWE-476