Closed Bug 1340803 Opened 3 years ago Closed 3 years ago

nsMIMEInfoWin::GetPossibleLocalHandlers may use nsAutoCString::First() on an empty string

Categories

(Firefox :: File Handling, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
Firefox 54
Tracking Status
firefox54 --- fixed

People

(Reporter: mayhemer, Assigned: mayhemer)

References

Details

Attachments

(1 file)

This is probably not super critical, since when the string is empty, First should return '\0'.  The code in question is |if (fileExt.First() != '.')| so that when the string is empty, the condition correctly doesn't pass.

Still, we want to enforce using First() only on non-empty strings, so this needs a small fix.
selfexplanatory
Assignee: nobody → honzab.moz
Status: NEW → ASSIGNED
Attachment #8838870 - Flags: review?(jmathies)
Attachment #8838870 - Flags: review?(jmathies) → review+
Keywords: checkin-needed
Pushed by ryanvm@gmail.com:
https://hg.mozilla.org/integration/mozilla-inbound/rev/f4eae24795b9
Make nsMIMEInfoWin::GetPossibleLocalHandlers check fileExt is non-empty before checking its first char. r=jimm
Keywords: checkin-needed
https://hg.mozilla.org/mozilla-central/rev/f4eae24795b9
Status: ASSIGNED → RESOLVED
Closed: 3 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 54
You need to log in before you can comment on or make changes to this bug.