From a8ab98e6cb12541bcc17d7206232402d5f026422 Mon Sep 17 00:00:00 2001 From: Doug MacEachern Date: Wed, 25 Aug 2004 17:06:21 +0000 Subject: [PATCH] check args.length before indexing --- bindings/java/src/net/hyperic/sigar/cmd/Ps.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/bindings/java/src/net/hyperic/sigar/cmd/Ps.java b/bindings/java/src/net/hyperic/sigar/cmd/Ps.java index e637a794..cbc33b38 100644 --- a/bindings/java/src/net/hyperic/sigar/cmd/Ps.java +++ b/bindings/java/src/net/hyperic/sigar/cmd/Ps.java @@ -151,7 +151,9 @@ public class Ps extends SigarCommandBase { else { try { String[] args = sigar.getProcArgs(pid); - name = args[0]; + if (args.length != 0) { + name = args[0]; + } } catch (SigarException e) {} }