mirror of
https://github.com/gyurix1968/guacamole-client.git
synced 2025-09-06 13:17:41 +00:00
GUAC-969: Fix possible NPE in XML parsing.
This commit is contained in:
@@ -140,8 +140,13 @@ public class DocumentHandler extends DefaultHandler {
|
||||
public void characters(char[] ch, int start, int length)
|
||||
throws SAXException {
|
||||
|
||||
// Get current state
|
||||
DocumentHandlerState current = getCurrentState();
|
||||
if (current == null)
|
||||
throw new SAXException("Character data not allowed outside XML document.");
|
||||
|
||||
// Append received chunk to text content
|
||||
getCurrentState().getTextContent().append(ch, start, length);
|
||||
current.getTextContent().append(ch, start, length);
|
||||
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user