We don't support unknown content lengths yet.

This commit is contained in:
Moxie Marlinspike 2013-03-03 18:50:13 -08:00
parent 2e55e9cdca
commit 01fdb1115d
1 changed files with 3 additions and 0 deletions

View File

@ -157,6 +157,9 @@ public class MmsCommunication {
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);