| Index: net/http/http_content_disposition.cc
|
| diff --git a/net/http/http_content_disposition.cc b/net/http/http_content_disposition.cc
|
| index 3f7d6b5f8a13b594b5015bc1b123cae80fc2527b..eb59b6d232bc3ea1eccb761947a2916a5c2f69e0 100644
|
| --- a/net/http/http_content_disposition.cc
|
| +++ b/net/http/http_content_disposition.cc
|
| @@ -6,6 +6,7 @@
|
|
|
| #include "base/base64.h"
|
| #include "base/logging.h"
|
| +#include "base/strings/string_piece.h"
|
| #include "base/strings/string_tokenizer.h"
|
| #include "base/strings/string_util.h"
|
| #include "base/strings/sys_string_conversions.h"
|
| @@ -353,8 +354,11 @@ std::string::const_iterator HttpContentDisposition::ConsumeDispositionType(
|
| // If the disposition-type isn't a valid token the then the
|
| // Content-Disposition header is malformed, and we treat the first bytes as
|
| // a parameter rather than a disposition-type.
|
| - if (!HttpUtil::IsToken(type_begin, type_end))
|
| + if (type_begin == type_end ||
|
| + !HttpUtil::IsToken(
|
| + base::StringPiece(&*type_begin, type_end - type_begin))) {
|
| return begin;
|
| + }
|
|
|
| parse_result_flags_ |= HAS_DISPOSITION_TYPE;
|
|
|
|
|