cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bhais...@apache.org
Subject [1/4] git commit: updated refs/heads/master to 0f4aac7
Date Mon, 15 Jun 2015 09:18:18 GMT
Repository: cloudstack
Updated Branches:
  refs/heads/master 7a57ce333 -> 0f4aac735


Fix findbugs SQL_PREPARED_STATEMENT_GENERATED_FROM_NONCONSTANT_STRING warning in Upgrade2214to30.java
There was no risk of sql injection here, nor any need to use PreparedStatement, still this
fixes the warninG

Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>

This closes #441


Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/869cc0c9
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/869cc0c9
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/869cc0c9

Branch: refs/heads/master
Commit: 869cc0c9f2a3ba9a5cfa07807e7331649605ab5e
Parents: 7a57ce3
Author: Rafael da Fonseca <rsafonseca@gmail.com>
Authored: Sun Jun 14 19:13:10 2015 +0200
Committer: Rohit Yadav <rohit.yadav@shapeblue.com>
Committed: Mon Jun 15 12:17:47 2015 +0300

----------------------------------------------------------------------
 engine/schema/src/com/cloud/upgrade/dao/Upgrade2214to30.java | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/869cc0c9/engine/schema/src/com/cloud/upgrade/dao/Upgrade2214to30.java
----------------------------------------------------------------------
diff --git a/engine/schema/src/com/cloud/upgrade/dao/Upgrade2214to30.java b/engine/schema/src/com/cloud/upgrade/dao/Upgrade2214to30.java
index b2b5e78..eb4e8c7 100644
--- a/engine/schema/src/com/cloud/upgrade/dao/Upgrade2214to30.java
+++ b/engine/schema/src/com/cloud/upgrade/dao/Upgrade2214to30.java
@@ -272,7 +272,8 @@ public class Upgrade2214to30 extends Upgrade30xBase implements DbUpgrade
{
                         addDefaultSGProvider(conn, physicalNetworkId, zoneId, networkType,
false);
                         //for all networks with this tag, add physical_network_id
 
-                        PreparedStatement pstmt3 = conn.prepareStatement("SELECT network_id
FROM `cloud`.`network_tags` where tag = '" + guestNetworkTag + "'");
+                        PreparedStatement pstmt3 = conn.prepareStatement("SELECT network_id
FROM `cloud`.`network_tags` where tag= ?");
+                        pstmt3.setString(1,guestNetworkTag);
                         ResultSet rsNet = pstmt3.executeQuery();
                         s_logger.debug("Adding PhysicalNetwork to VLAN");
                         s_logger.debug("Adding PhysicalNetwork to user_ip_address");


Mime
View raw message