diff options
author | Arne Schwabe <arne@rfc2549.org> | 2013-06-23 17:09:52 +0200 |
---|---|---|
committer | Arne Schwabe <arne@rfc2549.org> | 2013-06-23 17:09:52 +0200 |
commit | 0e76e955ba4848b18ee458cb9f53cc8e64671146 (patch) | |
tree | 818cb149d78d508dcc34fa6cdfc3e94e3655db4b /src/de/blinkt/openvpn/VpnProfile.java | |
parent | 180642560ef5c8a0139dcd50c1a7fa949c0c20f4 (diff) |
Fix issues found by Code Analysis
Diffstat (limited to 'src/de/blinkt/openvpn/VpnProfile.java')
-rw-r--r-- | src/de/blinkt/openvpn/VpnProfile.java | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/de/blinkt/openvpn/VpnProfile.java b/src/de/blinkt/openvpn/VpnProfile.java index e6ebae90..190cdf9a 100644 --- a/src/de/blinkt/openvpn/VpnProfile.java +++ b/src/de/blinkt/openvpn/VpnProfile.java @@ -449,7 +449,7 @@ public class VpnProfile implements Serializable{ } private boolean nonNull(String val) { - if(val == null || val.equals("")) + if(val == null || val.equals("")) return false; else return true; @@ -531,7 +531,7 @@ public class VpnProfile implements Serializable{ args.add(cacheDir.getAbsolutePath() + "/" + OVPNCONFIGFILE); - return (String[]) args.toArray(new String[args.size()]); + return args.toArray(new String[args.size()]); } public Intent prepareIntent(Context context) { @@ -584,11 +584,11 @@ public class VpnProfile implements Serializable{ try { Certificate cacert = X509Utils.getCertificateFromFile(mCaFilename); X509Certificate[] newcachain = new X509Certificate[cachain.length+1]; - for(int i=0;i<cachain.length;i++) - newcachain[i]=cachain[i]; + System.arraycopy(cachain, 0, newcachain, 0, cachain.length); newcachain[cachain.length-1]=(X509Certificate) cacert; + cachain=newcachain; } catch (Exception e) { OpenVPN.logError("Could not read CA certificate" + e.getLocalizedMessage()); } |