계: Code Quality

코드 품질이 낮으면 예측할 수 없는 동작이 발생합니다. 사용자 입장에서는 사용 편의성이 떨어지는 것으로 나타나는 경우가 많습니다. 공격자에게는 예상치 못한 방법으로 시스템에 부담을 줄 수 있는 기회가 됩니다.

Code Correctness: Erroneous Null Comparison

Abstract
x = NULLx != NULL 식은 항상 false가 됩니다.
Explanation
PL/SQL에서, NULL의 값은 불명확합니다. 이는 무엇과도 같지 않으며 다른 NULL 값과도 같지 않습니다. 또한 null 값은 다른 값과도 같지 않습니다.

예제 1:다음 문은 항상 false가 됩니다.


checkNull BOOLEAN := x = NULL;
예제 2:다음 문은 항상 false가 됩니다.


checkNotNull BOOLEAN := x != NULL;
References
[1] Steven Feuerstein Oracle PL/SQL Best Practices O'Reilly
[2] Standards Mapping - CIS Azure Kubernetes Service Benchmark 1.0
[3] Standards Mapping - CIS Amazon Elastic Kubernetes Service Benchmark 3.0
[4] Standards Mapping - CIS Amazon Web Services Foundations Benchmark 1
[5] Standards Mapping - CIS Google Kubernetes Engine Benchmark normal
[6] Standards Mapping - Common Weakness Enumeration CWE ID 480
desc.structural.sql.code_correctness_erroneous_null_comparison_plsql