Skip to content

Commit

Permalink
We don't support unknown content lengths yet.
Browse files Browse the repository at this point in the history
  • Loading branch information
moxie0 committed Mar 4, 2013
1 parent 2e55e9c commit 01fdb11
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/org/thoughtcrime/securesms/mms/MmsCommunication.java
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,9 @@ protected static byte[] parseResponse(HttpEntity entity) throws IOException {
if (entity == null || entity.getContentLength() == 0)
throw new IOException("Null response");

if (entity.getContentLength() < 0)
throw new IOException("Unknown content length!");

byte[] responseBytes = new byte[(int)entity.getContentLength()];
DataInputStream dataInputStream = new DataInputStream(entity.getContent());
dataInputStream.readFully(responseBytes);
Expand Down

0 comments on commit 01fdb11

Please sign in to comment.