Bug 1860321 - Check the return value of nsIFilePicker::GetDomFileOrDirectory, r=smaug

Differential Revision: https://phabricator.services.mozilla.com/D214265
This commit is contained in:
Andrea Marchesini
2024-06-19 16:08:21 +00:00
parent 761fe24fc0
commit c6f1009e59

View File

@@ -496,6 +496,10 @@ HTMLInputElement::nsFilePickerShownCallback::Done(
nsresult rv = mFilePicker->GetDomFileOrDirectory(getter_AddRefs(tmp));
NS_ENSURE_SUCCESS(rv, rv);
if (!tmp) {
return NS_OK;
}
// Show a prompt to get user confirmation before allowing folder access.
// This is to prevent sites from tricking the user into uploading files.
// See Bug 1338637.