Fix importing blacklist files larger than 4000 bytes

This commit is contained in:
xynngh 2020-10-23 14:40:28 +04:00
parent 29f7d7b5b5
commit 71be0cba7b
2 changed files with 7 additions and 1 deletions

View File

@ -7,6 +7,10 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
## [Unreleased] ## [Unreleased]
### Fixed
- Fixed importing blacklist files larger than 4000 bytes.
## [0.5.9] - 2020-10-20 ## [0.5.9] - 2020-10-20

View File

@ -120,7 +120,9 @@ public class BlacklistImporterExporter {
List<BlacklistItem> items = null; List<BlacklistItem> items = null;
try (BufferedInputStream bis = new BufferedInputStream(inputStream)) { try (BufferedInputStream bis = new BufferedInputStream(inputStream)) {
bis.mark(4000); // BufferedReaders used in `isYacbBackup` and `isNoPhoneSpamBackup` use 8192 char buffers,
// the max size of a UTF-8 char is 4 bytes.
bis.mark(8192 * 4);
if (isYacbBackup(new InputStreamReader(bis))) { if (isYacbBackup(new InputStreamReader(bis))) {
bis.reset(); bis.reset();