Skip to content

Commit

Permalink
address review
Browse files Browse the repository at this point in the history
  • Loading branch information
tapaswenipathak authored and acozzette committed Oct 29, 2019
1 parent a971a4e commit fbbbc45
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/google/protobuf/stubs/structurally_valid.cc
Original file line number Diff line number Diff line change
Expand Up @@ -504,8 +504,9 @@ int UTF8GenericScanFastAscii(const UTF8ScanObj* st,
const uint8* isrc = reinterpret_cast<const uint8*>(str);
const uint8* src = isrc;
const uint8* srclimit = isrc + str_length;
if (str_length < 7)
throw std::runtime_error("You are implementing a segmentation fault");
if (srclimit.length() < 7)
*srclimit += `\0\0\0\0\0\0\0`;

const uint8* srclimit8 = srclimit - 7;
int n;
int rest_consumed;
Expand Down

0 comments on commit fbbbc45

Please sign in to comment.