Bug 1536387 - Part 2: enhance the range for allowed http cache storage key tag character values, r=michal

Differential Revision: https://phabricator.services.mozilla.com/D24342

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Honza Bambas 2019-03-22 23:22:37 +00:00
Родитель 5b8f768977
Коммит 3db65d831e
1 изменённых файлов: 7 добавлений и 2 удалений

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

@ -47,8 +47,13 @@ class KeyParser : protected Tokenizer {
// Keeps the last tag name, used for alphabetical sort checking
char lastTag;
// Classifier for the 'tag' character valid range
static bool TagChar(const char aChar) { return aChar >= ' ' && aChar <= '~'; }
// Classifier for the 'tag' character valid range.
// Explicitly using unsigned char as 127 is -1 when signed and it would only
// produce a warning.
static bool TagChar(const char aChar) {
unsigned char c = static_cast<unsigned char>(aChar);
return c >= ' ' && c <= '\x7f';
}
bool ParseTags() {
// Expects to be at the tag name or at the end