commit 48955c898379ddff1380435e69b181d2c93622c7
parent 2a986c8635f3f368ba493b5b9c041cc572ccc0b1
Author: Dan Stillman <dstillman@zotero.org>
Date: Thu, 18 Sep 2014 17:32:45 -0400
Check ext length explicitly in createShortened when checking path length
Diffstat:
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git 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");
}
}