jira-importer commented on issue #446:
URL: https://github.com/apache/maven-indexer/issues/446#issuecomment-2965141504

   **[Jesse N. 
Glick](https://issues.apache.org/jira/secure/ViewProfile.jspa?name=jglick)** 
commented
   
   Something else I just noticed: `IndexDataReader.readIndex` reads and 
discards the first byte of the (uncompressed) stream, without checking that it 
is in fact `IndexDataWriter.VERSION`. Fixing this to throw an `IOException` for 
anything else would be a good idea in combination with my current patch, which 
just creates a `DataInputStream` from the raw input if it is not in GZIP format 
but cannot easily check that the input _is_ anything in particular: at least 
the reader upon being given random garbage would at least fail promptly in the 
common case that the first byte is not 0x01. (Would have been better for the 
index format to use a real magic number, but too late for that.)
   


-- 
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]

Reply via email to