Bug 1651977 - add MOZ_NO_VALIDATE r=tjr

Differential Revision: https://phabricator.services.mozilla.com/D83069
This commit is contained in:
Frederik Braun 2020-07-13 09:01:00 +00:00
Родитель 65dc39a8a9
Коммит c4e884127c
1 изменённых файлов: 4 добавлений и 2 удалений

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

@ -170,13 +170,15 @@ class Tainted {
(MOZ_IS_VALID(tainted_value, condition) ? tainted_value.Coerce() \
: alternate_value)
// This allows unsafe removal of the Taint wrapper.
// A justification string is required to explain why this is acceptable
#define MOZ_NO_VALIDATE(tainted_value, justification) tainted_value.Coerce()
/*
TODO:
- Figure out if there are helpers that would be useful for Strings and
Principals
- Create an unsafe getter that allows passing a string explanation, similar to
rlbox
- Write static analysis to enforce invariants:
- No use of .Coerce() except in the header file.
- No constant passed to the condition of MOZ_VALIDATE_AND_GET