mirror of
https://github.com/boostorg/log.git
synced 2026-01-19 04:22:09 +00:00
If the log file is configured for appending and rotation_size limit is set, text_file_backend::consume would repeatedly attempt to reopen the log file with a new counter value in attempt to find a file with a size below the rotation_size limit. This logic breaks if the file name pattern does not include a file counter placeholder, as it means the backend would repeatedly attempt to open the same file, whose size would exceed the limit. The loop would terminate after 2^32 iterations, but that may take a while. Avoid this fallback if we know the file counter placeholder is missing in the file name pattern. Also, make fil size checks more robust against integer overflows. Fixes https://github.com/boostorg/log/issues/252.