forked from solderpunk/AV-98
IPv6 might crash if disabled on the OS level
In his message "Bug in some gemini capsule", user Y C had crashes when connecting to IPv6 enabled capsule while IPv6 was disabled at OS level. This raised a crash when creating the socket in netcache gemini code. For whatever reason, the socket creation was not in the "try/catch" section. This should fix the issue.
This commit is contained in:
parent
e3e81fe344
commit
52a3ef643a
|
@ -11,6 +11,7 @@
|
|||
- ansicat: fixed a crash when parsing wrong hidden_url in gemini (bug #32)
|
||||
- offpunk: offpunk --version doesn’t create the cache anymore (bug #27)
|
||||
- ansicat: fix a crash with HTML without title (bug #33)
|
||||
- netcache: gemini socket code can crash when IPv6 is disabled (mailing-list)
|
||||
|
||||
## 2.0 - November 16th 2023
|
||||
Changes since 1.10
|
||||
|
|
|
@ -634,10 +634,10 @@ def _fetch_gemini(url,timeout=DEFAULT_TIMEOUT,interactive=True,accept_bad_ssl_ce
|
|||
# Connect to remote host by any address possible
|
||||
err = None
|
||||
for address in addresses:
|
||||
s = socket.socket(address[0], address[1])
|
||||
s.settimeout(timeout)
|
||||
s = context.wrap_socket(s, server_hostname = host)
|
||||
try:
|
||||
s = socket.socket(address[0], address[1])
|
||||
s.settimeout(timeout)
|
||||
s = context.wrap_socket(s, server_hostname = host)
|
||||
s.connect(address[4])
|
||||
break
|
||||
except OSError as e:
|
||||
|
|
Loading…
Reference in New Issue