using defusedxml ElementTree for safer parsing of untrusted XML data (#9934)
* using defusexml ElementTree for safer parsing of untrusted XML data * move from core dependency to platform specific dependency * style difference: put back end of list comma in setup.py
This commit is contained in:
parent
587948ec06
commit
1bec2c005d
4 changed files with 11 additions and 1 deletions
|
@ -6,7 +6,6 @@ https://home-assistant.io/components/device_tracker.upc_connect/
|
|||
"""
|
||||
import asyncio
|
||||
import logging
|
||||
import xml.etree.ElementTree as ET
|
||||
|
||||
import aiohttp
|
||||
import async_timeout
|
||||
|
@ -19,6 +18,8 @@ from homeassistant.const import CONF_HOST
|
|||
from homeassistant.helpers.aiohttp_client import async_get_clientsession
|
||||
|
||||
|
||||
REQUIREMENTS = ['defusedxml==0.5.0']
|
||||
|
||||
_LOGGER = logging.getLogger(__name__)
|
||||
|
||||
DEFAULT_IP = '192.168.0.1'
|
||||
|
@ -63,6 +64,8 @@ class UPCDeviceScanner(DeviceScanner):
|
|||
@asyncio.coroutine
|
||||
def async_scan_devices(self):
|
||||
"""Scan for new devices and return a list with found device IDs."""
|
||||
import defusedxml.ElementTree as ET
|
||||
|
||||
if self.token is None:
|
||||
token_initialized = yield from self.async_initialize_token()
|
||||
if not token_initialized:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue