forked from I2P_Developers/i2p.i2p
i2psnark: Fix NPE caused by URL-to-URI conversion in -2 (ticket #1715)
Fix some other similar places
This commit is contained in:
@ -907,6 +907,8 @@ public class TrackerClient implements Runnable {
|
||||
if (!"http".equals(url.getScheme()))
|
||||
return null;
|
||||
String host = url.getHost();
|
||||
if (host == null)
|
||||
return null;
|
||||
if (host.endsWith(".i2p"))
|
||||
return ConvertToHash.getHash(host);
|
||||
if (host.equals("i2p")) {
|
||||
|
@ -116,6 +116,8 @@ public class I2PSocketEepGet extends EepGet {
|
||||
URI url = new URI(_actualURL);
|
||||
if ("http".equals(url.getScheme())) {
|
||||
String host = url.getHost();
|
||||
if (host == null)
|
||||
throw new MalformedURLException("no hostname: " + _actualURL);
|
||||
int port = url.getPort();
|
||||
if (port <= 0 || port > 65535)
|
||||
port = 80;
|
||||
|
Reference in New Issue
Block a user