[protobuf] Fix ubsan error in text_format
@@ -1216,7 +1216,7 @@ class TextFormat::Printer::TextGenerator
Write(text + pos, size - pos);
} else {
Write(text, size);
- if (text[size - 1] == '\n') {
+ if (size > 0 && text[size - 1] == '\n') {
at_start_of_line_ = true;
}
}
