Comments (8)
It's covered by tests though
from junrar.
It works with the unicode.rar
file, effectively:
ウニコド.txt: 67
新建文本文档.txt: 10
Maybe the file I created is encoded differently? I made it with Winrar on Windows checking the RAR4 format.
from junrar.
I cannot reproduce on my macbook, it works fine. Could it be something with how your Java is configured?
from junrar.
Would you be able to produce a minimum reproducible repo on Github, showing that it works with a previous version and fails with 7.5.4?
from junrar.
I'm using Windows 10 64 bits and Adoptium JDK 11.0.16.1+1 (I also tried Adoptium JDK 18.0.2.1+1).
Here is the reproductible repo, with my outputs in the README file: https://github.com/AlexisJehan/JunrarIssue108
(The issue appears since Junrar 7.5.3)
from junrar.
Thanks, I have a fair idea where the bug could be, but I want to perform a repro first.
from junrar.
I managed to perform a repo on Gihub CI, it only fails on Windows with your file.
Archives have both a fileName
and fileNameW
, where the latter is the unicode one.
On Mac in CI, we get this:
07:00:29.751 [Test worker] WARN com.github.junrar.rarfile.FileHeader - Archive filename: ?.txt
07:00:29.752 [Test worker] WARN com.github.junrar.rarfile.FileHeader - Archive filenameW: テ.txt
07:00:29.752 [Test worker] WARN com.github.junrar.rarfile.FileHeader - Archive isUnicode: true
07:00:29.752 [Test worker] WARN com.github.junrar.rarfile.FileHeader - Archive getFileName: テ.txt
And on Windows:
07:00:47.789 [Test worker] WARN com.github.junrar.rarfile.FileHeader - Archive filename: ?.txt
07:00:47.789 [Test worker] WARN com.github.junrar.rarfile.FileHeader - Archive filenameW: ?.txt
07:00:47.789 [Test worker] WARN com.github.junrar.rarfile.FileHeader - Archive isUnicode: true
07:00:47.789 [Test worker] WARN com.github.junrar.rarfile.FileHeader - Archive getFileName: ?.txt
For the existing unicode archive we had, we get something different:
On Mac:
07:00:29.770 [Test worker] WARN com.github.junrar.rarfile.FileHeader - Archive filename: ウニコド.txt
07:00:29.770 [Test worker] WARN com.github.junrar.rarfile.FileHeader - Archive filenameW: ウニコド.txt
07:00:29.770 [Test worker] WARN com.github.junrar.rarfile.FileHeader - Archive isUnicode: true
07:00:29.770 [Test worker] WARN com.github.junrar.rarfile.FileHeader - Archive getFileName: ウニコド.txt
07:00:29.771 [Test worker] WARN com.github.junrar.rarfile.FileHeader - Archive filename: 新建文本文档.txt
07:00:29.775 [Test worker] WARN com.github.junrar.rarfile.FileHeader - Archive filenameW: 新建文本文档.txt
07:00:29.775 [Test worker] WARN com.github.junrar.rarfile.FileHeader - Archive isUnicode: true
07:00:29.775 [Test worker] WARN com.github.junrar.rarfile.FileHeader - Archive getFileName: 新建文本文档.txt
On Windows:
07:00:47.789 [Test worker] WARN com.github.junrar.rarfile.FileHeader - Archive filename: ウニコド.txt
07:00:47.789 [Test worker] WARN com.github.junrar.rarfile.FileHeader - Archive filenameW: ????.txt
07:00:47.789 [Test worker] WARN com.github.junrar.rarfile.FileHeader - Archive isUnicode: true
07:00:47.789 [Test worker] WARN com.github.junrar.rarfile.FileHeader - Archive getFileName: ????.txt
07:00:47.805 [Test worker] WARN com.github.junrar.rarfile.FileHeader - Archive filename: 新建文本文档.txt
07:00:47.805 [Test worker] WARN com.github.junrar.rarfile.FileHeader - Archive filenameW: ??????.txt
07:00:47.805 [Test worker] WARN com.github.junrar.rarfile.FileHeader - Archive isUnicode: true
07:00:47.805 [Test worker] WARN com.github.junrar.rarfile.FileHeader - Archive getFileName: ??????.txt
Additional validity checks were added in 7.5.3:
if (!isFilenameValid(fileName)) {
throw new CorruptHeaderException("Invalid filename: " + fileName);
}
if (!isFilenameValid(fileNameW)) {
throw new CorruptHeaderException("Invalid filename: " + fileNameW);
}
private static boolean isFilenameValid(String filename) {
try {
String ignored = new File(filename).getCanonicalPath();
return true;
} catch (IOException e) {
return false;
}
}
There's a few things i don't yet understand:
- why
isFilenameValid
fails with?.txt
but not????.txt
- how the existing unicode archive manages to pass the test
assertThat(names).containsExactlyInAnyOrder("新建文本文档.txt", "ウニコド.txt");
It might be an encoding issue in the console output, while internally in Java it works.
from junrar.
🎉 This issue has been resolved in v7.5.5
(Release Notes)
from junrar.
Related Issues (20)
- Get a specific inputstream from a rar containing multiple items. HOT 1
- Error unpacking large file(>2G) HOT 10
- Could the junrar project benefit from free security help?
- How to disable logging in System.err? HOT 2
- FileHeader times change depending on the current timezone HOT 9
- FileTime.fromMillis(getDateDos(fileTime)) is not working below android API 26 HOT 2
- Remove dependency from org.slf4j.LoggerFactory HOT 7
- CrcErrorException HOT 4
- [BUG] Compress HOT 1
- [BUG]A carefully crafted RAR archive can trigger an infinite loop while parsing. HOT 10
- com.github.junrar.exception.CrcErrorException during extracting of archive HOT 2
- [BUG]A carefully crafted RAR archive can trigger an infinite loop while parsing HOT 21
- [BUG] NullPointerException when extracting solid archives HOT 6
- [BUG]com.github.junrar.exception.CorruptHeaderException: null HOT 2
- [BUG] Exception swallowed during initialization -- silently missing data we used to get in 7.4.1 HOT 11
- [BUG] "IllegalArgumentException: Pipe Size <= 0" with an empty file in the archive HOT 9
- Integration with Google oss-fuzz fuzzing service HOT 2
- Hrlp me HOT 1
- [BUG] Pom License link leads to 404 HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from junrar.