Переглянути джерело

fix potential format string pollution

Some URLs may have a format string pattern in them, which
will cause the argument count to be incorrect and crash
the enqueue. This locks in the key and URL to be plain
strings and completely uninterpreted to avoid this issue.
tags/v0.4.1
Chlod Alejandro 5 місяці тому
джерело
коміт
2e0199f652
Не вдалося знайти GPG ключ що відповідає даному підпису Ідентифікатор GPG ключа: A1E67C59037B0CC1
1 змінених файлів з 4 додано та 3 видалено
  1. +4
    -3
      src/earwigbot/wiki/copyvios/workers.py

+ 4
- 3
src/earwigbot/wiki/copyvios/workers.py Переглянути файл

@@ -493,12 +493,13 @@ class CopyvioWorkspace:

key = ".".join(urlparse(url).netloc.split(".")[-2:])

logmsg = f"enqueue(): %s {key} -> {url}"
matchup = f"{key} -> {url}"
logmsg = f"enqueue(): %s %s"
if key in self._queues.sites:
self._logger.debug(logmsg % "append")
self._logger.debug(logmsg % ("append", matchup))
self._queues.sites[key].append(source)
else:
self._logger.debug(logmsg % "new")
self._logger.debug(logmsg % ("new", matchup))
q: SourceQueue = collections.deque()
q.append(source)
self._queues.sites[key] = q


Завантаження…
Відмінити
Зберегти