Make message text null-terminated

This commit is contained in:
huangqinjin 2020-05-11 22:32:02 +08:00
parent 3ba8976592
commit d8998fe4f6

View File

@ -1509,6 +1509,7 @@ void LogMessage::Flush() {
original_final_char = data_->message_text_[data_->num_chars_to_log_];
data_->message_text_[data_->num_chars_to_log_++] = '\n';
}
data_->message_text_[data_->num_chars_to_log_] = '\0';
// Prevent any subtle race conditions by wrapping a mutex lock around
// the actual logging action per se.