socks: more checks for tor resolve.
This commit is contained in:
parent
2552b3fca3
commit
e05fb77d33
@ -497,8 +497,12 @@ SOCKS.prototype.handleResolve = function handleResolve(data) {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
this.state = SOCKS.states.RESOLVE_DONE;
|
if (addr.type === 0x03) {
|
||||||
|
this.error('Bad address type for tor resolve.');
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
this.state = SOCKS.states.RESOLVE_DONE;
|
||||||
this.destroy();
|
this.destroy();
|
||||||
|
|
||||||
this.emit('resolve', [addr.host]);
|
this.emit('resolve', [addr.host]);
|
||||||
@ -697,7 +701,11 @@ function parseAddr(data, offset) {
|
|||||||
throw new Error('Unknown SOCKS address type: ' + type + '.');
|
throw new Error('Unknown SOCKS address type: ' + type + '.');
|
||||||
}
|
}
|
||||||
|
|
||||||
return { host: host, port: port };
|
return {
|
||||||
|
type: type,
|
||||||
|
host: host,
|
||||||
|
port: port
|
||||||
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user