fix(#289): crash due to invalid UDP socks5 packet received
This commit is contained in:
parent
2dd99130fa
commit
0da43e1643
1 changed files with 8 additions and 1 deletions
|
@ -241,7 +241,14 @@ pub async fn run_server(
|
||||||
|
|
||||||
let (destination_addr, data) = {
|
let (destination_addr, data) = {
|
||||||
let payload = buf.split().freeze();
|
let payload = buf.split().freeze();
|
||||||
let (frag, destination_addr, data) = fast_socks5::parse_udp_request(payload.chunk()).await.unwrap();
|
let (frag, destination_addr, data) = match fast_socks5::parse_udp_request(payload.chunk()).await {
|
||||||
|
Ok((frag, addr, data)) => (frag, addr, data),
|
||||||
|
Err(err) => {
|
||||||
|
warn!("Skipping invalid UDP socks5 request: {} ", err);
|
||||||
|
debug!("Invalid UDP socks5 request: {:?}", payload.chunk());
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
};
|
||||||
// We don't support udp fragmentation
|
// We don't support udp fragmentation
|
||||||
if frag != 0 {
|
if frag != 0 {
|
||||||
warn!("dropping UDP socks5 fragmented");
|
warn!("dropping UDP socks5 fragmented");
|
||||||
|
|
Loading…
Reference in a new issue