]> source.dussan.org Git - sonarqube.git/commitdiff
SONAR-9087 AlterColumnsBuilder must validate table name
authorSébastien Lesaint <sebastien.lesaint@sonarsource.com>
Thu, 13 Apr 2017 13:45:32 +0000 (15:45 +0200)
committerSébastien Lesaint <sebastien.lesaint@sonarsource.com>
Thu, 27 Apr 2017 12:25:54 +0000 (14:25 +0200)
server/sonar-db-migration/src/main/java/org/sonar/server/platform/db/migration/sql/AlterColumnsBuilder.java

index 222fcc660eb925f7a601b166ea3ab4397099fefb..3471389aad6b2f27afa0c3dcf388c9f5e30277e7 100644 (file)
@@ -31,6 +31,7 @@ import org.sonar.server.platform.db.migration.def.ColumnDef;
 
 import static com.google.common.base.Preconditions.checkArgument;
 import static com.google.common.collect.Lists.newArrayList;
+import static org.sonar.server.platform.db.migration.def.Validations.validateTableName;
 
 /**
  * Generate SQL queries to update multiple columns of a single table.
@@ -52,7 +53,7 @@ public class AlterColumnsBuilder {
 
   public AlterColumnsBuilder(Dialect dialect, String tableName) {
     this.dialect = dialect;
-    this.tableName = tableName;
+    this.tableName = validateTableName(tableName);
   }
 
   public AlterColumnsBuilder updateColumn(ColumnDef columnDef) {