ppkarwasz commented on code in PR #685:
URL: https://github.com/apache/commons-compress/pull/685#discussion_r2265372434
##########
src/main/java/org/apache/commons/compress/archivers/ar/ArArchiveInputStream.java:
##########
@@ -211,25 +202,25 @@ private String getBSDLongName(final String bsdLongName)
throws IOException {
*/
private String getExtendedName(final int offset) throws IOException {
if (namebuffer == null) {
- throw new ArchiveException("Cannot process GNU long file name as
no // record was found");
+ throw new ArchiveException("Cannot process GNU long file name as
no GNU string table was found");
+ }
+ if (offset < 0 || offset >= namebuffer.length) {
Review Comment:
While `ParsingUtils.parseIntValue` will **not** throw an exception for
negative values, the parsed string can **not** contain a sign, so this
improvement is justified.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]