summaryrefslogtreecommitdiffstats
path: root/ecomp-portal-BE-common/src/main/java/org
diff options
context:
space:
mode:
authorSunder Tattavarada <statta@research.att.com>2019-06-18 16:04:36 +0000
committerGerrit Code Review <gerrit@onap.org>2019-06-18 16:04:36 +0000
commit2a462c99939b19f972813b64c7a4d6e33b9aaa5a (patch)
tree08c96378a6de50412d24309bde8fa04883b931f4 /ecomp-portal-BE-common/src/main/java/org
parent37ea104d5c99b4100381cc0e8e79be3feb98a0ec (diff)
parent44484dc3fe12385b64defb2f287826285e890a65 (diff)
Merge "Fix sql injection vulnerability"
Diffstat (limited to 'ecomp-portal-BE-common/src/main/java/org')
-rw-r--r--ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/service/UserRolesCommonServiceImpl.java8
1 files changed, 6 insertions, 2 deletions
diff --git a/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/service/UserRolesCommonServiceImpl.java b/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/service/UserRolesCommonServiceImpl.java
index a440c311..656cf9ea 100644
--- a/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/service/UserRolesCommonServiceImpl.java
+++ b/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/service/UserRolesCommonServiceImpl.java
@@ -557,7 +557,9 @@ public class UserRolesCommonServiceImpl {
// Delete from fn_menu_functional_roles
@SuppressWarnings("unchecked")
List<FunctionalMenuRole> funcMenuRoles = localSession
- .createQuery("from " + FunctionalMenuRole.class.getName() + " where roleId=" + roleId)
+ .createQuery("from :name where roleId=:roleId")
+ .setParameter("name",FunctionalMenuRole.class.getName())
+ .setParameter("roleId",roleId)
.list();
int numMenuRoles = funcMenuRoles.size();
logger.debug(EELFLoggerDelegate.debugLogger,
@@ -569,7 +571,9 @@ public class UserRolesCommonServiceImpl {
// so must null out the url too, to be consistent
@SuppressWarnings("unchecked")
List<FunctionalMenuRole> funcMenuRoles2 = localSession
- .createQuery("from " + FunctionalMenuRole.class.getName() + " where menuId=" + menuId)
+ .createQuery("from :name where menuId=:menuId")
+ .setParameter("name",FunctionalMenuRole.class.getName())
+ .setParameter("menuId",menuId)
.list();
int numMenuRoles2 = funcMenuRoles2.size();
logger.debug(EELFLoggerDelegate.debugLogger,