From 2bb9251043b543bb5005b7cf9af6ac4f58a0f733 Mon Sep 17 00:00:00 2001 From: "Smokowski, Steve (ss835w)" Date: Wed, 5 Dec 2018 08:30:51 -0500 Subject: Resolve Security Exploits normalize all file paths before using them Change-Id: I67aaa00d7218b95dde96f3679efe92c3c0cd33f9 Issue-ID: SO-1275 Signed-off-by: Smokowski, Steve (ss835w) --- .../src/main/java/db/migration/R__CloudConfigMigration.java | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'adapters') diff --git a/adapters/mso-openstack-adapters/src/main/java/db/migration/R__CloudConfigMigration.java b/adapters/mso-openstack-adapters/src/main/java/db/migration/R__CloudConfigMigration.java index 10dbbf1396..6339616803 100644 --- a/adapters/mso-openstack-adapters/src/main/java/db/migration/R__CloudConfigMigration.java +++ b/adapters/mso-openstack-adapters/src/main/java/db/migration/R__CloudConfigMigration.java @@ -36,6 +36,7 @@ import org.onap.so.logger.MsoLogger; import java.io.FileInputStream; import java.io.IOException; import java.io.InputStream; +import java.nio.file.Paths; import java.sql.Connection; import java.sql.PreparedStatement; import java.sql.ResultSet; @@ -68,9 +69,11 @@ public class R__CloudConfigMigration implements JdbcMigration , MigrationInfoPro // Try the override file String configLocation = System.getProperty("spring.config.location"); if (configLocation != null) { - try (InputStream stream = new FileInputStream(configLocation)) { + try (InputStream stream = new FileInputStream(Paths.get(configLocation).normalize().toString())) { cloudConfig = loadCloudConfig(stream); - } + }catch(Exception e){ + LOGGER.warnSimple("Error Loading override.yaml",e); + } } if (cloudConfig == null) { -- cgit 1.2.3-korg