From 70691e843a5ca80f8cd47bf2cde20ac53c09b2b5 Mon Sep 17 00:00:00 2001 From: Niki Roo Date: Mon, 27 Apr 2020 18:08:14 +0200 Subject: [PATCH] potential crash on inforeader --- supported/InfoReader.java | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/supported/InfoReader.java b/supported/InfoReader.java index 1a00ef2..405b28f 100644 --- a/supported/InfoReader.java +++ b/supported/InfoReader.java @@ -259,14 +259,17 @@ public class InfoReader { String value = getLine(in, key, 0); if (value != null && !value.isEmpty()) { value = value.trim().substring(key.length() - 1).trim(); - if (value.startsWith("'") && value.endsWith("'") - || value.startsWith("\"") && value.endsWith("\"")) { + if (value.length() > 1 && // + (value.startsWith("'") && value.endsWith("'") + || value.startsWith("\"") + && value.endsWith("\""))) { value = value.substring(1, value.length() - 1).trim(); } // Some old files ended up with TITLE="'xxxxx'" - if ("TITLE".equals(key)) { - if (value.startsWith("'") && value.endsWith("'")) { + if ("^TITLE=".equals(key)) { + if (value.startsWith("'") && value.endsWith("'") + && value.length() > 1) { value = value.substring(1, value.length() - 1).trim(); } } -- 2.27.0