From ff6dbd6bdefae01927ed3461277435f6b098370c Mon Sep 17 00:00:00 2001 From: Bas van Schaik Date: Fri, 28 Apr 2017 14:54:47 +0100 Subject: [PATCH] Fix lgtm.com alert: cast int to long before multiplication The integer multiplication has the potential to overflow before the result is being cast to the 'long' result. Details: https://lgtm.com/projects/g/keycloak/keycloak/snapshot/dist-7900299-1490802114895/files/saml-core/src/main/java/org/keycloak/saml/processing/core/saml/v2/util/XMLTimeUtil.java#V133 --- .../saml/processing/core/saml/v2/util/XMLTimeUtil.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/saml-core/src/main/java/org/keycloak/saml/processing/core/saml/v2/util/XMLTimeUtil.java b/saml-core/src/main/java/org/keycloak/saml/processing/core/saml/v2/util/XMLTimeUtil.java index 31916ff627..8510d47658 100755 --- a/saml-core/src/main/java/org/keycloak/saml/processing/core/saml/v2/util/XMLTimeUtil.java +++ b/saml-core/src/main/java/org/keycloak/saml/processing/core/saml/v2/util/XMLTimeUtil.java @@ -130,7 +130,7 @@ public class XMLTimeUtil { * @return */ public static long inMilis(int valueInMins) { - return valueInMins * 60 * 1000; + return (long) valueInMins * 60 * 1000; } /** @@ -241,4 +241,4 @@ public class XMLTimeUtil { } } } -} \ No newline at end of file +}