Skip to content

Commit 301768b

Browse files
committed
Add length check
1 parent c3377a9 commit 301768b

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

cluster/src/org/labkey/cluster/pipeline/SlurmExecutionEngine.java

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -499,6 +499,14 @@ private String extractField(String line, List<String> fieldWidths, int idx)
499499

500500
try
501501
{
502+
if (end > line.length())
503+
{
504+
_log.debug("Encountered slurm line shorter than expected. Slurm field at idx: " + idx + ". Line: [" + line + "]");
505+
_log.debug("fieldWidths: " + StringUtils.join(fieldWidths, "|"));
506+
507+
return null;
508+
}
509+
502510
return StringUtils.trimToNull(line.substring(start, end));
503511
}
504512
catch (Exception e)

0 commit comments

Comments
 (0)