Page 1 of 1

bug in Storage

Posted: 20 Nov 2025 22:14
by Zaalar
Hi,
there is a bug in i2psnark:

Storage.createFileFromNames
around line 927

wrong:
private File createFileFromNames(File base, final List<String> names, final boolean areFilesPublic) throws IOException {
File f = null;
final var it = names.iterator();
-> if (it.hasNext()) {
final var name = optFilterName(it.next());
if (it.hasNext()) {
correct:
private File createFileFromNames(File base, final List<String> names, final boolean areFilesPublic) throws IOException {
File f = null;
final var it = names.iterator();
-> WHILE (it.hasNext()) {
final var name = optFilterName(it.next());
if (it.hasNext()) {

When there are subdirs, checking of torrents will loop endlessly.