You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudstack.apache.org by hu...@apache.org on 2014/09/19 11:56:06 UTC

[1/2] git commit: updated refs/heads/master to 90df7cf

Repository: cloudstack
Updated Branches:
  refs/heads/master 6687727b7 -> 90df7cf88


CID-1116298 path can be null, make sure that is properly handled


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

Branch: refs/heads/master
Commit: 6f54d48772fc6e3a7b756c330b9569a5a2215b74
Parents: 6687727
Author: Hugo Trippaers <ht...@schubergphilis.com>
Authored: Fri Sep 19 11:54:21 2014 +0200
Committer: Hugo Trippaers <ht...@schubergphilis.com>
Committed: Fri Sep 19 11:54:21 2014 +0200

----------------------------------------------------------------------
 utils/src/com/cloud/utils/script/Script.java | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/6f54d487/utils/src/com/cloud/utils/script/Script.java
----------------------------------------------------------------------
diff --git a/utils/src/com/cloud/utils/script/Script.java b/utils/src/com/cloud/utils/script/Script.java
index d2656a8..9713b14 100755
--- a/utils/src/com/cloud/utils/script/Script.java
+++ b/utils/src/com/cloud/utils/script/Script.java
@@ -308,7 +308,7 @@ public class Script implements Callable<String> {
         public Task(OutputInterpreter interpreter, BufferedReader reader) {
             this.interpreter = interpreter;
             this.reader = reader;
-            this.result = null;
+            result = null;
         }
 
         @Override
@@ -340,8 +340,6 @@ public class Script implements Callable<String> {
     public static String findScript(String path, String script) {
         s_logger.debug("Looking for " + script + " in the classpath");
 
-        path = path.replace("/", File.separator);
-
         URL url = ClassLoader.getSystemResource(script);
         s_logger.debug("System resource: " + url);
         File file = null;
@@ -351,6 +349,12 @@ public class Script implements Callable<String> {
             return file.getAbsolutePath();
         }
 
+        if (path == null) {
+            s_logger.warn("No search path specified, unable to look for " + script);
+            return null;
+        }
+        path = path.replace("/", File.separator);
+
         /**
          * Look in WEB-INF/classes of the webapp
          * URI workaround the URL encoding of url.getFile


[2/2] git commit: updated refs/heads/master to 90df7cf

Posted by hu...@apache.org.
CID-1116300 Prevent potential NPE


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

Branch: refs/heads/master
Commit: 90df7cf88144b4fa05bdf4d0719bdaac8e564e4a
Parents: 6f54d48
Author: Hugo Trippaers <ht...@schubergphilis.com>
Authored: Fri Sep 19 11:55:17 2014 +0200
Committer: Hugo Trippaers <ht...@schubergphilis.com>
Committed: Fri Sep 19 11:55:17 2014 +0200

----------------------------------------------------------------------
 core/src/com/cloud/resource/ServerResourceBase.java | 4 ++++
 1 file changed, 4 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/90df7cf8/core/src/com/cloud/resource/ServerResourceBase.java
----------------------------------------------------------------------
diff --git a/core/src/com/cloud/resource/ServerResourceBase.java b/core/src/com/cloud/resource/ServerResourceBase.java
index a24ea98..69ddb29 100755
--- a/core/src/com/cloud/resource/ServerResourceBase.java
+++ b/core/src/com/cloud/resource/ServerResourceBase.java
@@ -122,6 +122,10 @@ public abstract class ServerResourceBase implements ServerResource {
             }
         }
         String infos[] = NetUtils.getNetworkParams(_privateNic);
+        if (infos == null) {
+            s_logger.warn("Incorrect details for private Nic during initialization of ServerResourceBase");
+            return false;
+        }
         params.put("host.ip", infos[0]);
         params.put("host.mac.address", infos[1]);