Merge pull request #622 from sergiud/max_log_size-overflow

handle --max_log_size overflow
This commit is contained in:
Sergiu Deitsch 2021-03-30 23:59:53 +02:00 committed by GitHub
commit e27f141194
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -341,7 +341,7 @@ static const char* GetAnsiColorCode(GLogColor color) {
// Safely get max_log_size, overriding to 1 if it somehow gets defined as 0
static int32 MaxLogSize() {
return (FLAGS_max_log_size > 0 ? FLAGS_max_log_size : 1);
return (FLAGS_max_log_size > 0 && FLAGS_max_log_size < 4096 ? FLAGS_max_log_size : 1);
}
// An arbitrary limit on the length of a single log message. This