rvesse opened a new issue, #2402:
URL: https://github.com/apache/jena/issues/2402

   ### Version
   
   5.0.0
   
   ### What happened?
   
   Consider the following test case:
   
   ```java
       @Test
       public void junk_01() {
           byte[] junkData = "junk".getBytes(StandardCharsets.UTF_8);
           RDFPatch patch = read(new ByteArrayInputStream(junkData));
           Assert.fail("Malformed binary stream should throw an error");
       }
   ```
   
   Since the input is not a patch in RDF Thrift format it would be expected 
that an error would be thrown.  Instead an empty patch is returned and the 
error is silently ignored.
   
   This bit of the code seems relevant:
   
   ```java
     try { row.read(protocol) ; }
     catch (TTransportException e) {
         if ( e.getType() == TTransportException.END_OF_FILE )
             break;
         throw new PatchException("Thrift exception", e);
     }
   ```
   
   It seems like it always treats an EOF as an acceptable error, irregardless 
of whether the input was genuinely at EOF or EOF was simply encountered due to 
malformed/incomplete data.
   
   ### Relevant output and stacktrace
   
   _No response_
   
   ### Are you interested in making a pull request?
   
   Maybe


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


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to