parent
167ee017f2
commit
77b7e3a0c9
2 changed files with 6 additions and 3 deletions
|
|
@ -1503,13 +1503,15 @@ def parse_pom(path=None, contents=None):
|
||||||
contents = fixEncoding(contents)
|
contents = fixEncoding(contents)
|
||||||
|
|
||||||
try:
|
try:
|
||||||
xml.sax.parseString(contents, handler) # nosec - trusted data
|
# trusted data, skipping bandit test
|
||||||
|
xml.sax.parseString(contents, handler) # nosec
|
||||||
except xml.sax.SAXParseException:
|
except xml.sax.SAXParseException:
|
||||||
# likely an undefined entity reference, so lets try replacing
|
# likely an undefined entity reference, so lets try replacing
|
||||||
# any entity refs we can find and see if we get something parseable
|
# any entity refs we can find and see if we get something parseable
|
||||||
handler.reset()
|
handler.reset()
|
||||||
contents = ENTITY_RE.sub('?', contents)
|
contents = ENTITY_RE.sub('?', contents)
|
||||||
xml.sax.parseString(contents, handler) # nosec - trusted data
|
# trusted data, skipping bandit test
|
||||||
|
xml.sax.parseString(contents, handler) # nosec
|
||||||
|
|
||||||
for field in fields:
|
for field in fields:
|
||||||
if field not in util.to_list(values.keys()):
|
if field not in util.to_list(values.keys()):
|
||||||
|
|
|
||||||
|
|
@ -751,7 +751,8 @@ class VMExecTask(BaseTaskHandler):
|
||||||
raise koji.BuildError('unsupported file type: %s' % type)
|
raise koji.BuildError('unsupported file type: %s' % type)
|
||||||
koji.ensuredir(os.path.dirname(localpath))
|
koji.ensuredir(os.path.dirname(localpath))
|
||||||
# closing needs to be used for requests < 2.18.0
|
# closing needs to be used for requests < 2.18.0
|
||||||
# nosec - skipping missing timeout, it would be done on VM lifecycle level
|
# skipping missing timeout, it would be done on VM lifecycle level
|
||||||
|
# bypass bandit warning
|
||||||
with closing(requests.get(remote_url, stream=True)) as response: # nosec
|
with closing(requests.get(remote_url, stream=True)) as response: # nosec
|
||||||
response.raise_for_status()
|
response.raise_for_status()
|
||||||
with open(localpath, 'wb') as f:
|
with open(localpath, 'wb') as f:
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue