Fix importing blacklist files larger than 4000 bytes
This commit is contained in:
parent
29f7d7b5b5
commit
71be0cba7b
|
@ -7,6 +7,10 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
|
|||
|
||||
## [Unreleased]
|
||||
|
||||
### Fixed
|
||||
|
||||
- Fixed importing blacklist files larger than 4000 bytes.
|
||||
|
||||
|
||||
## [0.5.9] - 2020-10-20
|
||||
|
||||
|
|
|
@ -120,7 +120,9 @@ public class BlacklistImporterExporter {
|
|||
List<BlacklistItem> items = null;
|
||||
|
||||
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))) {
|
||||
bis.reset();
|
||||
|
|
Loading…
Reference in New Issue