Przeglądaj źródła

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 miesięcy temu
rodzic
commit
2e0199f652
Nie znaleziono w bazie danych klucza dla tego podpisu ID klucza GPG: A1E67C59037B0CC1
1 zmienionych plików z 4 dodań i 3 usunięć
  1. +4
    -3
      src/earwigbot/wiki/copyvios/workers.py

+ 4
- 3
src/earwigbot/wiki/copyvios/workers.py Wyświetl plik

@@ -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


Ładowanie…
Anuluj
Zapisz