33 lines
886 B
Plaintext
33 lines
886 B
Plaintext
A reference to ``++None++`` should never be dereferenced/accessed. Doing so will cause an exception to be thrown. At best, such an exception will cause abrupt program termination. At worst, it could expose debugging information that would be useful to an attacker, or it could allow an attacker to bypass security measures.
|
|
|
|
== Noncompliant Code Example
|
|
|
|
----
|
|
def myfunc(param):
|
|
if param is None:
|
|
print(param.test()) # Noncompliant
|
|
|
|
if param == None:
|
|
print(param.test()) # Noncompliant
|
|
|
|
if param is not None:
|
|
pass
|
|
else:
|
|
print(param.test()) # Noncompliant
|
|
|
|
if param != None:
|
|
pass
|
|
else:
|
|
print(param.test()) # Noncompliant
|
|
|
|
----
|
|
|
|
include::../see.adoc[]
|
|
|
|
ifdef::env-github,rspecator-view[]
|
|
== Comments And Links
|
|
(visible only on this page)
|
|
|
|
include::../comments-and-links.adoc[]
|
|
endif::env-github,rspecator-view[]
|