소스 검색

address review

Tapasweni Pathak 6 년 전
부모
커밋
fbbbc45ae5
1개의 변경된 파일3개의 추가작업 그리고 2개의 파일을 삭제
  1. 3 2
      src/google/protobuf/stubs/structurally_valid.cc

+ 3 - 2
src/google/protobuf/stubs/structurally_valid.cc

@@ -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;