From 23fa4836c95b62c073f8c5061bd3628d194a97be Mon Sep 17 00:00:00 2001 From: XenoAmess Date: Thu, 11 Feb 2021 23:05:12 +0800 Subject: [PATCH] bug : compare strings using != --- .../src/main/java/com/metasploit/meterpreter/Utils.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/java/meterpreter/meterpreter/src/main/java/com/metasploit/meterpreter/Utils.java b/java/meterpreter/meterpreter/src/main/java/com/metasploit/meterpreter/Utils.java index c337d779..768f6238 100644 --- a/java/meterpreter/meterpreter/src/main/java/com/metasploit/meterpreter/Utils.java +++ b/java/meterpreter/meterpreter/src/main/java/com/metasploit/meterpreter/Utils.java @@ -29,8 +29,9 @@ public class Utils { public static String getHostname() { try { String result = InetAddress.getLocalHost().getHostName(); - if (result != "") + if (result.length() != 0) { return result; + } } catch (UnknownHostException e) { } String host = System.getenv("COMPUTERNAME");