From 48955c898379ddff1380435e69b181d2c93622c7 Mon Sep 17 00:00:00 2001 From: Dan Stillman Date: Thu, 18 Sep 2014 17:32:45 -0400 Subject: [PATCH] Check ext length explicitly in createShortened when checking path length --- chrome/content/zotero/xpcom/file.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/chrome/content/zotero/xpcom/file.js b/chrome/content/zotero/xpcom/file.js index 0822914d1..e6467c7ee 100644 --- a/chrome/content/zotero/xpcom/file.js +++ b/chrome/content/zotero/xpcom/file.js @@ -354,7 +354,8 @@ Zotero.File = new function(){ let pathLength = pathByteLength - fileNameByteLength; newLength -= pathLength; - if (newLength < 5) { + // Make sure there's a least 1 character of the basename left over + if (newLength - ext.length < 1) { throw new Error("Path is too long"); } }