Catch negative literal sizes in imap responses
Check for negative sizes for literals so that we don't crash attempting to create a negative sized array. Bug:15834346 Change-Id: I1fbd9b86c807f1e97100fbfe52ef402a337bf655
This commit is contained in:
parent
2eecdd1a50
commit
9adf186c5b
|
@ -438,6 +438,9 @@ public class ImapResponseParser {
|
|||
} catch (NumberFormatException nfe) {
|
||||
throw new MessagingException("Invalid length in literal");
|
||||
}
|
||||
if (size < 0) {
|
||||
throw new MessagingException("Invalid negative length in literal");
|
||||
}
|
||||
expect('\r');
|
||||
expect('\n');
|
||||
FixedLengthInputStream in = new FixedLengthInputStream(mIn, size);
|
||||
|
|
Loading…
Reference in New Issue