aboutsummaryrefslogtreecommitdiff
path: root/src/google/protobuf/compiler/objectivec/objectivec_file.cc
diff options
context:
space:
mode:
authorSergio Campama <kaipi@google.com>2016-07-22 12:55:20 -0400
committerSergio Campama <kaipi@google.com>2016-07-22 12:56:36 -0400
commit2ff93494a7edff2b00eaaf0982de11420740be52 (patch)
tree6e699dac3d5b040b25043ba18d44500b486113b1 /src/google/protobuf/compiler/objectivec/objectivec_file.cc
parent2ba058c66c10781d57a332987be23e3fed0f9e1c (diff)
downloadprotobuf-2ff93494a7edff2b00eaaf0982de11420740be52.tar.gz
protobuf-2ff93494a7edff2b00eaaf0982de11420740be52.tar.bz2
protobuf-2ff93494a7edff2b00eaaf0982de11420740be52.zip
Fixes the parsing of the proto-framework map file.
- Fixes memory issue where the pointer to the StringPiece would be allocated on the stack, and would mangle the output. - Fixes length of the file name when parsing the comma separated files.
Diffstat (limited to 'src/google/protobuf/compiler/objectivec/objectivec_file.cc')
-rw-r--r--src/google/protobuf/compiler/objectivec/objectivec_file.cc2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/google/protobuf/compiler/objectivec/objectivec_file.cc b/src/google/protobuf/compiler/objectivec/objectivec_file.cc
index cf8c34e1..b864ef12 100644
--- a/src/google/protobuf/compiler/objectivec/objectivec_file.cc
+++ b/src/google/protobuf/compiler/objectivec/objectivec_file.cc
@@ -223,7 +223,7 @@ bool ImportWriter::ProtoFrameworkCollector::ConsumeLine(
offset = proto_file_list.length();
}
- StringPiece proto_file(proto_file_list, start, offset);
+ StringPiece proto_file(proto_file_list, start, offset - start);
StringPieceTrimWhitespace(&proto_file);
if (proto_file.size() != 0) {
map<string, string>::iterator existing_entry =