# HG changeset patch # User Frank-Rainer Grahl # Date 1623162001 14400 # Parent b717801f74b5a32084334578c65d07b1a7c559ea Bug 365384 - Handle exception from newURI. diff --git a/suite/mailnews/phishingDetector.js b/suite/mailnews/phishingDetector.js --- a/suite/mailnews/phishingDetector.js +++ b/suite/mailnews/phishingDetector.js @@ -84,17 +84,21 @@ function isPhishingURL(aLinkNode, aSilen var phishingType = kPhishingNotSuspicious; var href = aHref || aLinkNode.href; if (!href) return false; var linkTextURL = {}; var isPhishingURL = false; - var hrefURL = Services.io.newURI(href); + var hrefURL; + // make sure relative link urls don't make us bail out + try { + hrefURL = Services.io.newURI(href); + } catch(ex) { return false; } // only check for phishing urls if the url is an http or https link. // this prevents us from flagging imap and other internally handled urls if (hrefURL.schemeIs('http') || hrefURL.schemeIs('https')) { let ipAddress = isLegalIPAddress(hrefURL.host, true); if (ipAddress && !isLegalLocalIPAddress(ipAddress)) phishingType = kPhishingWithIPAddress;