From 6db3552e69843d1febe9da0fdbffba49359b3c48 Mon Sep 17 00:00:00 2001 From: Honza Bambas Date: Sat, 18 Feb 2017 07:31:00 -0500 Subject: [PATCH] Bug 1340803 - Make nsMIMEInfoWin::GetPossibleLocalHandlers check fileExt is non-empty before checking its first char. r=jimm --HG-- extra : rebase_source : a3d43e53ddd9f0b5d084434bad88ac0463f8686f --- uriloader/exthandler/win/nsMIMEInfoWin.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/uriloader/exthandler/win/nsMIMEInfoWin.cpp b/uriloader/exthandler/win/nsMIMEInfoWin.cpp index 2c7171c87703..956cbda427a6 100644 --- a/uriloader/exthandler/win/nsMIMEInfoWin.cpp +++ b/uriloader/exthandler/win/nsMIMEInfoWin.cpp @@ -612,8 +612,9 @@ nsMIMEInfoWin::GetPossibleLocalHandlers(nsIArray **_retval) } nsAutoString fileExtToUse; - if (fileExt.First() != '.') + if (!fileExt.IsEmpty() && fileExt.First() != '.') { fileExtToUse = char16_t('.'); + } fileExtToUse.Append(NS_ConvertUTF8toUTF16(fileExt)); // Note, the order in which these occur has an effect on the