You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Observed behaviour:
CogniCrypt reports an IncompleteOperationError:
in Method: void main(java.lang.String[])
IncompleteOperationError violating CrySL rule for java.security.MessageDigest (on Object #21334a6508c8e9b9d3a43e9e47be125f2820991e8ca23877503bb4947a169144)
Operation on object of type java.security.MessageDigest object not completed. Expected call to digest
at statement: $r5 = virtualinvoke r1.<java.security.MessageDigest: java.lang.Object clone()>()
Expected behavior:
As clone() creates a shallow copy of md, c1 is an alias of md. Thus, the operation isn't incomplete and no report is expected. (Already discussed with @kruegers )
However, as clone() can also create a deep copy - if implemented - and the byte code handles md and c1 as two separate objects, I am fine with another solution as well.
The text was updated successfully, but these errors were encountered:
kruegers
changed the title
Calls to copy does not create an alias
Calls to clone does not create an alias
Apr 1, 2020
CogniCrypt and Ruleset used: v2.7.1
Simplified jar-file: MessageDigestClone.zip
Analyzed code (excerp):
Observed behaviour:
CogniCrypt reports an IncompleteOperationError:
Expected behavior:
As
clone()
creates a shallow copy ofmd
,c1
is an alias ofmd
. Thus, the operation isn't incomplete and no report is expected. (Already discussed with @kruegers )However, as
clone()
can also create a deep copy - if implemented - and the byte code handlesmd
andc1
as two separate objects, I am fine with another solution as well.The text was updated successfully, but these errors were encountered: