Bug 1346720 - Disallow invalid report IDs early on. r=gerald

MozReview-Commit-ID: GBDnzYh0gPt
This commit is contained in:
Frederik Braun 2017-03-13 18:40:45 -04:00
Родитель 658552e990
Коммит 9e93fd0d84
2 изменённых файлов: 5 добавлений и 0 удалений

Просмотреть файл

@ -249,6 +249,10 @@ let gDecoderDoctorHandler = {
// resolution of that issue, to be reported as telemetry.
let {type, isSolved, decoderDoctorReportId, formats} = parsedData;
type = type.toLowerCase();
// Error out early on invalid ReportId
if (!(/^\w+$/mi).test(decoderDoctorReportId)) {
return
}
let title = gDecoderDoctorHandler.getLabelForNotificationBox(type);
if (!title) {
return;

Просмотреть файл

@ -247,6 +247,7 @@ DecoderDoctorDocumentWatcher::EnsureTimerIsStarted()
}
}
// Note: ReportStringIds are limited to alphanumeric only.
static const NotificationAndReportStringId sMediaWidevineNoWMF=
{ dom::DecoderDoctorNotificationType::Platform_decoder_not_found,
"MediaWidevineNoWMF" };