author Ted Campbell <tcampbell@mozilla.com>
Tue, 28 Nov 2017 23:01:49 -0500
changeset 442685 84ca5dce1d6a63bc64612876eccee30fc45080f9
parent 369155 2e262535fc7358975b86240798c75cf624f39870
permissions -rw-r--r--
Bug 1418894 - Harden XDR data decoding. r=nbp a=gchang This patch adds better error detection to XDR decoding to reduce memory corruption in the event that XDR data is corrupt (which is not *supposed* to happen). Add missing default cases. Make out-of-range values fail the decode by asserting in debug, and returning a TranscodeError in release. Mix a magic value into enum value before transcoding to buffer (to reduce chance of garbage data being decoded). MozReview-Commit-ID: 1wPkho9dm8c

# Checks run by clang-tidy over Mozilla code.

# The following checks are currently enabled:
# * modernize-raw-string-literal -
#     Replace string literals containing escaped characters with raw string literals
# * modernize-use-bool-literals
#     Replace integer literals which are cast to bool
# * modernize-loop-convert
#     Converts for(...; ...; ...) loops to use the new range-based loops in C++11
# * modernize-use-default
#     Replace default bodies of special member functions with = default;
# * modernize-use-override
#     Use C++11's override and remove virtual where applicable

Checks:          '-*, modernize-raw-string-literal, modernize-use-bool-literals, modernize-loop-convert, modernize-use-default, modernize-use-override'