Open mgautierfr opened 1 year ago
Sounds like ZIMception... (sorry, couldn't resit that 😉). Seriously, though, is this a realistic scenario (ZIM inside ZIM) that I need to be aware of and handle in the Kiwix JS backend?
@Jaifroid This is a scenario for custom apps utltimatively (ZIM file part of the Android app resource file). Not aware about an other one and actually wonder how @mgautierfr came to detect that bug.
actually wonder how @mgautierfr came to detect that bug.
When working on the java wrapping and wanted to check with a embedded zim file. See : https://github.com/kiwix/java-libkiwix/blob/main/lib/src/test/test.java#L238-L239
@Jaifroid This is a scenario for custom apps ultimately (ZIM file part of the Android app resource file). Not aware about an other one and actually wonder how @mgautierfr came to detect that bug.
Ah, OK, thanks.
Zim file can be embedded in another file. We can open such a zim file with the fd
Archive
constructorHowever, calling check on the such archive fails. This probably comes from the verify implementation (https://github.com/openzim/libzim/blob/main/src/fileimpl.cpp#L563-L604) which don't care of the initial offset in the fd.