Skip to content

Commit

Permalink
Merge pull request #213 from hyperwallet/feature/LI-38226_Resource_le…
Browse files Browse the repository at this point in the history
…ak_causes_vulnerable_code_in_Request_class

closed connection to fix security bug.
  • Loading branch information
akalichety-hw authored Apr 30, 2024
2 parents 89d171d + c17bb82 commit d1d5b6d
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/main/java/com/hyperwallet/clientsdk/util/Request.java
Original file line number Diff line number Diff line change
Expand Up @@ -267,7 +267,11 @@ private BinaryResponse readBinaryResponse() throws IOException {
} catch (IOException e) {
response.setBinaryBody(getBinaryFromStream(connection.getErrorStream()));
}
return response;
finally {
connection.getInputStream().close();
return response;
}

}

private byte[] getBinaryFromStream(final InputStream is) {
Expand Down

0 comments on commit d1d5b6d

Please sign in to comment.