WebKit Bugzilla
Attachment 348014 Details for
Bug 180526
: Update MIME type parser
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch
bug-180526-20180824175309.patch (text/plain), 2.32 KB, created by
Rob Buis
on 2018-08-24 08:53:11 PDT
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
Rob Buis
Created:
2018-08-24 08:53:11 PDT
Size:
2.32 KB
patch
obsolete
>Subversion Revision: 235090 >diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog >index 39fa429adf4e06361a0d19b5bbd907ac70bf5d27..f1bbcedf0754a9e41a6b12398d8f73bd79835db8 100644 >--- a/Source/WebCore/ChangeLog >+++ b/Source/WebCore/ChangeLog >@@ -1,3 +1,15 @@ >+2018-08-24 Rob Buis <rbuis@igalia.com> >+ >+ Update MIME type parser >+ https://bugs.webkit.org/show_bug.cgi?id=180526 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ Require type and subtype tokens. >+ >+ * platform/network/ParsedContentType.cpp: >+ (WebCore::parseContentType): >+ > 2018-08-20 Jeremy Jones <jeremyj@apple.com> > > UIWebView crashes while attempting to play youtube video on phone >diff --git a/Source/WebCore/platform/network/ParsedContentType.cpp b/Source/WebCore/platform/network/ParsedContentType.cpp >index 2d553f874625ca82971abf8766a0a8c52ed9fb0c..2cb9e33dc56126570d577c07fc37f6353b8ef2e4 100644 >--- a/Source/WebCore/platform/network/ParsedContentType.cpp >+++ b/Source/WebCore/platform/network/ParsedContentType.cpp >@@ -160,14 +160,32 @@ bool parseContentType(const String& contentType, ReceiverType& receiver) > return false; > } > >+ unsigned contentTypeStart = index; >+ auto typeRange = parseToken(contentType, index); >+ if (!typeRange.second) { >+ LOG_ERROR("Invalid Content-Type, invalid type value."); >+ return false; >+ } >+ >+ if (contentType[index++] != '/') { >+ LOG_ERROR("Invalid Content-Type, missing '/'."); >+ return false; >+ } >+ >+ auto subTypeRange = parseToken(contentType, index); >+ if (!subTypeRange.second) { >+ LOG_ERROR("Invalid Content-Type, invalid subtype value."); >+ return false; >+ } >+ > // There should not be any quoted strings until we reach the parameters. > size_t semiColonIndex = contentType.find(';', index); > if (semiColonIndex == notFound) { >- receiver.setContentType(SubstringRange(index, contentTypeLength - index)); >+ receiver.setContentType(SubstringRange(contentTypeStart, contentTypeLength - contentTypeStart)); > return true; > } > >- receiver.setContentType(SubstringRange(index, semiColonIndex - index)); >+ receiver.setContentType(SubstringRange(contentTypeStart, semiColonIndex - contentTypeStart)); > index = semiColonIndex + 1; > while (true) { > skipSpaces(contentType, index);
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 180526
:
348014
|
356923
|
356928
|
357400
|
357401
|
357403
|
357443
|
357469
|
357682
|
357684
|
357687
|
357690
|
357691
|
357702
|
358515
|
358898
|
358906
|
358907
|
358917
|
359860
|
360118
|
360123
|
360129
|
360134
|
360136
|
360144
|
360303
|
360343
|
360350
|
360355
|
362245
|
362316
|
362323
|
362342
|
362348
|
362360
|
362378
|
362384
|
362387
|
362390
|
362397
|
362416
|
362418
|
362430
|
362437
|
362483
|
362486
|
362497
|
362506
|
362526
|
390349