Merge pull request #552 from huangqinjin/master

Make message text null-terminated
This commit is contained in:
Sergiu Deitsch 2020-09-29 22:11:22 +02:00 committed by GitHub
commit 024b095d7e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

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.