From 036a1faffaa68de433672be74e97b7093d11dfea Mon Sep 17 00:00:00 2001 From: Slavomir Date: Tue, 30 Jun 2020 23:00:19 +0300 Subject: [PATCH] Remove redundancy --- ql/src/experimental/Unsafe/WrongUsageOfUnsafe.ql | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/ql/src/experimental/Unsafe/WrongUsageOfUnsafe.ql b/ql/src/experimental/Unsafe/WrongUsageOfUnsafe.ql index 20769f9beb1..d3060bb0ba1 100644 --- a/ql/src/experimental/Unsafe/WrongUsageOfUnsafe.ql +++ b/ql/src/experimental/Unsafe/WrongUsageOfUnsafe.ql @@ -63,7 +63,6 @@ predicate castShortArrayToLongerArray( ( arrFrom = getBaseType(castLittle.getOperand().getType()) or - castLittle.getOperand().getChildExpr(0) instanceof IndexExpr and arrFrom = castLittle.getOperand().getChildExpr(0).(IndexExpr).getBase().getType() ) and arrTo.getLength() > 0 and //TODO @@ -90,10 +89,7 @@ predicate castTypeToArray(DataFlow::PathNode source, DataFlow::PathNode sink, st arrTo = getBaseType(castBig.getTypeExpr().getType()) and not (typeFrom instanceof ArrayType or typeFrom.getUnderlyingType() instanceof ArrayType) and not typeFrom instanceof PointerType and - not ( - castLittle.getOperand().getChildExpr(0) instanceof IndexExpr and - castLittle.getOperand().getChildExpr(0).(IndexExpr).getBase().getType() instanceof ArrayType - ) and + not castLittle.getOperand().getChildExpr(0).(IndexExpr).getBase().getType() instanceof ArrayType and typeFrom = getBaseType(castLittle.getOperand().getType()) and message = "Dangerous type up-casting to [" + arrTo.getLength() + "]" + arrTo.getElementType() + " from "