1. mquigley
  2. ZabbixJ

Commits

mquigley  committed ffb5e3f

Found a bug, where when the returned value for a key was less than 4 characters long, we'd get an index out of bounds problem.

  • Participants
  • Parent commits c4d9439
  • Branches default

Comments (0)

Files changed (1)

File src/java/com/quigley/zabbixj/client/PassiveAgentClient.java

View file
 				String inputLine = input.readLine();
 				socket.close();
 
-				if(inputLine.substring(0, 4).equals("ZBXD")) {
+				if(inputLine.length() >= 4 && inputLine.substring(0, 4).equals("ZBXD")) {
 					inputLine = inputLine.substring(13, inputLine.length());
 				}
 				
 	
 	private InetAddress agentAddress;
 	private int port;
-}
+}