Commit 7958aa90 authored by Joshua Haberman's avatar Joshua Haberman Committed by Copybara-Service
Browse files

Check for invalid escaping when parsing the default value of a bytes field.

The code that loads descriptors calls absl::CUnescape() to parse the escape sequences.  Prior to this CL, we were not checking the return value of this call, effectively allowing the invalid data to be loaded.

If a user is compiling a .proto file, invalid escapes will be caught earlier in the compiler pipeline, and this check will be unnecessary.  The only time this is an issue is when a descriptor has been constructed manually and is loaded into the runtime.

This bug manifested as an MSAN failure in a fuzz test, because in the error case absl::CUnescape() will return a string where some of the characters are uninitialized.

PiperOrigin-RevId: 511319279
parent b51858aa
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment