mirror of
https://github.com/vanitasvitae/Smack.git
synced 2024-11-22 12:02:05 +01:00
Add 'null' check to parseContentDepth
Does not fix the actual problem, but at least prevents resource allocation until OOM.
This commit is contained in:
parent
e0b8577930
commit
98333e362d
1 changed files with 5 additions and 1 deletions
|
@ -156,7 +156,11 @@ public class PacketParserUtils {
|
|||
public static String parseContentDepth(XmlPullParser parser, int depth) throws XmlPullParserException, IOException {
|
||||
StringBuilder content = new StringBuilder();
|
||||
while (!(parser.next() == XmlPullParser.END_TAG && parser.getDepth() == depth)) {
|
||||
content.append(parser.getText());
|
||||
String text = parser.getText();
|
||||
if (text == null) {
|
||||
throw new IllegalStateException("Parser should never return 'null' on getText() here");
|
||||
}
|
||||
content.append(text);
|
||||
}
|
||||
return content.toString();
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue